Thread

  1. Re: [PATCH] Fix pg_dump emitting OVERRIDING SYSTEM VALUE for tables with dropped identity columns

    Andreas Karlsson <andreas@proxel.se> — 2026-05-01T07:28:28Z

    On 4/18/26 01:29, William Bernbaum wrote:
    > Hey hackers,
    > 
    > I’ve encountered a small issue in pg_dump.
    > 
    > It currently emits OVERRIDING SYSTEM VALUE in INSERTs for
    > 
    > a table that doesn't have an identity column if it used to have
    > 
    > a GENERATED ALWAYS AS IDENTITY column that was later dropped.
    > 
    > [...]
    > 
    > Patch attached.
    > 
    > Thoughts?
    
    Nicely spotted and thanks for the patch! Please add it to the currently 
    open commitfest (https://commitfest.postgresql.org/59/) so it is not lost.
    
    I have two pieces of feedback:
    
    1. I think the code would be easier to read as
    
    if (!tbinfo->attisdropped[j])
         tbinfo->needs_override = tbinfo->needs_override || 
    tbinfo->attidentity[j] == ATTRIBUTE_IDENTITY_ALWAYS;
    
    or even
    
    if (tbinfo->attidentity[j] == ATTRIBUTE_IDENTITY_ALWAYS && 
    !tbinfo->attisdropped[j])
         tbinfo->needs_override = true;
    
    since then we do not get such a long line.
    
    2. While I am not personally a fan of that file it would be more 
    consistent if the new test was added as part of 002_pg_dump.pl if 
    possible. Plus then it would mean that we would not need to create and 
    tear down a PostgreSQL cluster.
    
    Andreas
    
    
    
    
    
    
  2. Re: [PATCH] Fix pg_dump emitting OVERRIDING SYSTEM VALUE for tables with dropped identity columns

    Andreas Karlsson <andreas@proxel.se> — 2026-05-01T07:39:07Z

    On 5/1/26 09:28, Andreas Karlsson wrote:
    > On 4/18/26 01:29, William Bernbaum wrote:
    >> Patch attached.
    
    Forgot this: Maybe it is just a bit too early in the morning and I have 
    not had coffee yet but I struggled a bit to apply your patch. A 
    recommendation for making patches easy to apply for other developers is 
    to generate them with the "git format-patch" command which makes them 
    easy to apply with "git am". You can use the "-v" flag to "git 
    format-patch" if you want to add a version number to the generated file 
    names.
    Also another question worth looking into is if this same bug affects 
    other things, e.g. the setting of hasdefaults.
    
    Thanks again for the patch!
    
    --
    Andreas Karlsson
    Percona