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: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cf/5285~1
Choose a base ref
...
head repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cf/5285
Choose a head ref
  • 4 commits
  • 18 files changed
  • 3 contributors

Commits on Mar 31, 2025

  1. Remove hastriggers flag check before fetching FK constraints.

    With NOT ENFORCED, foreign key constraints will be created without
    triggers. Therefore, the criteria for fetching foreign keys based on
    the presence of triggers no longer apply.
    
    ----
    NOTE: This patch is intended to reduce the diff noise from the main
    patch and is not meant to be committed separately. It should be
    squashed with the main patch that adds ENFORCED/NOT ENFORCED.
    ----
    amulsul authored and Commitfest Bot committed Mar 31, 2025
    Configuration menu
    Copy the full SHA
    cb7d8fa View commit details
    Browse the repository at this point in the history
  2. Add support for NOT ENFORCED in foreign key constraints.

    Typically, when a foreign key (FK) constraint is created on a table,
    action and check triggers are added to maintain data integrity.  With
    this patch, if a constraint is marked as NOT ENFORCED, integrity
    checks are no longer required, making these triggers unnecessary.
    Consequently, when creating a NOT ENFORCED FK constraint, triggers
    will not be created, and the constraint will be marked as NOT VALID.
    Similarly, if an existing FK constraint is changed to NOT ENFORCED,
    the associated triggers will be dropped, and the constraint will also
    be marked as NOT VALID. Conversely, if a NOT ENFORCED FK constraint is
    changed to ENFORCED, the necessary triggers will be created, and the
    will be changed to VALID by performing necessary validation.
    
    ----
    NOTE: In this patch, the tryAttachPartitionForeignKey() function will
    not merge the constraint if the enforcibility differs. This will be
    addressed in the next patch.
    ----
    amulsul authored and Commitfest Bot committed Mar 31, 2025
    Configuration menu
    Copy the full SHA
    60a3e9e View commit details
    Browse the repository at this point in the history
  3. Merge the parent and child constraints with differing enforcibility.

    If an ENFORCED parent constraint is attached to a NOT ENFORCED child
    constraint, the child constraint will be made ENFORCED, with
    validation applied if the parent constraint is validated as well.
    Otherwise, a new ENFORCED constraint (with validation, if the parent
    constraint is validated) would need to be created on the child table,
    which would be unnecessary if a similar constraint already exists and
    can be attached.
    
    On the other hand, having a NOT ENFORCED parent constraint with an
    ENFORCED child constraint does not cause any issues, and no changes
    are required.
    
    ----
    NOTE: This patch is intended to reduce the diff noise from the main
    patch and is not meant to be committed separately. It should be
    squashed with the main patch that adds ENFORCED/NOT ENFORCED.
    ----
    EDB-AmulSul authored and Commitfest Bot committed Mar 31, 2025
    Configuration menu
    Copy the full SHA
    8c8fb5c View commit details
    Browse the repository at this point in the history
  4. [CF 5285] v21 - NOT ENFORCED constraint feature

    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5285
    
    The branch will be overwritten each time a new patch version is posted to
    the thread, and also periodically to check for bitrot caused by changes
    on the master branch.
    
    Patch(es): https://www.postgresql.org/message-id/CAAJ_b94B8PByv_b4oxhHDzbGzjoY8cptKGAu-GX0_eiOkqEhHQ@mail.gmail.com
    Author(s): Amul Sul
    Commitfest Bot committed Mar 31, 2025
    Configuration menu
    Copy the full SHA
    ff5ac04 View commit details
    Browse the repository at this point in the history
Loading