Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: postgres/postgres
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master@{1day}
Choose a base ref
...
head repository: postgres/postgres
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 5 commits
  • 10 files changed
  • 2 contributors

Commits on Jun 20, 2025

  1. Use SnapshotDirty when checking for conflicting index names.

    While choosing an autogenerated name for an index, look for
    pre-existing relations using a SnapshotDirty snapshot, instead of the
    previous behavior that considered only committed-good pg_class rows.
    This allows us to detect and avoid conflicts against indexes that are
    still being built.
    
    It's still possible to fail due to a race condition, but the window
    is now just the amount of time that it takes DefineIndex to validate
    all its parameters, call smgrcreate(), and enter the index's pg_class
    row.  Formerly the race window covered the entire time needed to
    create and fill an index, which could be very long if the table is
    large.  Worse, if the conflicting index creation is part of a larger
    transaction, it wouldn't be visible till COMMIT.
    
    So this isn't a complete solution, but it should greatly ameliorate
    the problem, and the patch is simple enough to be back-patchable.
    
    It might at some point be useful to do the same for pg_constraint
    entries (cf. ChooseConstraintName, ConstraintNameExists, and related
    functions).  However, in the absence of field complaints, I'll leave
    that alone for now.  The relation-name test should be good enough for
    index-based constraints, while foreign-key constraints seem to be okay
    since they require exclusive locks to create.
    
    Bug: #18959
    Reported-by: Maximilian Chrzan <maximilian.chrzan@here.com>
    Author: Tom Lane <tgl@sss.pgh.pa.us>
    Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com>
    Discussion: https://postgr.es/m/18959-f63b53b864bb1417@postgresql.org
    Backpatch-through: 13
    tglsfdc committed Jun 20, 2025
    Configuration menu
    Copy the full SHA
    5861b1f View commit details
    Browse the repository at this point in the history
  2. Remove planner's have_dangerous_phv() join-order restriction.

    Commit 85e5e22, which added (a forerunner of) this logic,
    argued that
    
        Adding the necessary complexity to make this work doesn't seem like
        it would be repaid in significantly better plans, because in cases
        where such a PHV exists, there is probably a corresponding join order
        constraint that would allow a good plan to be found without using the
        star-schema exception.
    
    The flaw in this claim is that there may be other join-order
    restrictions that prevent us from finding a join order that doesn't
    involve a "dangerous" PHV.  In particular we now recognize that
    small join_collapse_limit or from_collapse_limit could prevent it.
    Therefore, let's bite the bullet and make the case work.
    
    We don't have to extend the executor's support for nestloop parameters
    as I thought at the time, because we can instead push the evaluation
    of the placeholder's expression into the left-hand input of the
    NestLoop node.  So there's not really a lot of downside to this
    solution, and giving the planner more join-order flexibility should
    have value beyond just avoiding failure.
    
    Having said that, there surely is a nonzero risk of introducing
    new bugs.  Since this failure mode escaped detection for ten years,
    such cases don't seem common enough to justify a lot of risk.
    Therefore, let's put this fix into master but leave the back branches
    alone (for now anyway).
    
    Bug: #18953
    Reported-by: Alexander Lakhin <exclusion@gmail.com>
    Diagnosed-by: Richard Guo <guofenglinux@gmail.com>
    Author: Tom Lane <tgl@sss.pgh.pa.us>
    Discussion: https://postgr.es/m/18953-1c9883a9d4afeb30@postgresql.org
    tglsfdc committed Jun 20, 2025
    Configuration menu
    Copy the full SHA
    a16ef31 View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2025

  1. Configuration menu
    Copy the full SHA
    fed7aa8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d21cf31 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fa638ed View commit details
    Browse the repository at this point in the history
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy