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/6087~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/6087
Choose a head ref
  • 4 commits
  • 15 files changed
  • 2 contributors

Commits on Jan 2, 2026

  1. add relOid field to CreateTrigStmt

    add the relOid field to CreateTrigStmt is very useful for copying or recreating
    a CreateTrigStmt.
    Copying CreateTrigStmt node can happen like CREATE TABLE LIKE INCLUDING TRIGGERS.
    To let ALTER COLUMN SET DATA TYPE cope with trigger dependencies, we need get
    the trigger definition then do parse analysis for CreateTrigStmt again.
    
    in function CreateTrigger, we have below comments:
    ```
    * relOid, if nonzero, is the relation on which the trigger should be * created.
    If zero, the name provided in the statement will be looked up.
    ```
    
    We can move the "relOid" argument out of the CreateTrigger function’s parameter
    list and instead store it in CreateTrigStmt.
    The following are the reason why:
    
    1. CreateTrigger has too many arguments; reducing the argument list by one is a good thing.
    2. To implement CREATE TABLE LIKE INCLUDING TRIGGERS, we need to pass the new
    relation OID to CreateTrigger, but it's not doable from
    ProcessUtilitySlow->CreateTrigger.
    3. To allow ALTER COLUMN SET DATA TYPE to cope with trigger dependencies, we
    also need to pass the new relation OID to CreateTrigger, which for the same
    reason as above cannot be done from ProcessUtilitySlow. This can help to reduce
    repeated lookup issue.
    
    discussion: https://postgr.es/m/CACJufxHJAr2FjbeB6ghg_-N5dxX5JVnjKSLOUxOyt4TeaAWQkg@mail.gmail.com
    discussion: https://postgr.es/m/CACJufxGkqYrmwMdvUOUPet0443oUTgF_dKCpw3TfJiutfuywAQ@mail.gmail.com
    commitfest: https://commitfest.postgresql.org/patch/6087
    commitfest: https://commitfest.postgresql.org/patch/6089
    jianhe-fun authored and Commitfest Bot committed Jan 2, 2026
    Configuration menu
    Copy the full SHA
    32b5df1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    65593d1 View commit details
    Browse the repository at this point in the history
  3. CREATE TABLE LIKE INCLUDING TRIGGERS

    This will copy all source table's trigger to the new table.  Internal trigger
    (such as foreign key associated trigger) won't being copied to new table.
    However this command will fail if the source table's trigger contain whole-row
    reference.
    
    Trigger's comment will copied to new table, if INCLUDING COMMENTS is specified.
    
    CREATE FOREIGN TABLE LIKE is also supported.
    
    discussion: https://postgr.es/m/CACJufxHJAr2FjbeB6ghg_-N5dxX5JVnjKSLOUxOyt4TeaAWQkg@mail.gmail.com
    commitfest: https://commitfest.postgresql.org/patch/6087
    jianhe-fun authored and Commitfest Bot committed Jan 2, 2026
    Configuration menu
    Copy the full SHA
    3305745 View commit details
    Browse the repository at this point in the history
  4. [CF 6087] v4 - CREATE TABLE LIKE INCLUDING TRIGGERS

    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/6087
    
    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/CACJufxHMYq2ZqvOhoSKUmx+wZUo=HixjfgGKDJ6L4cdCvwh2VA@mail.gmail.com
    Author(s): Jian He
    Commitfest Bot committed Jan 2, 2026
    Configuration menu
    Copy the full SHA
    5096eff View commit details
    Browse the repository at this point in the history
Loading