Re: pg_restore - generated column - not populating

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Santosh Udupi <email(at)hitha(dot)net>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: pg_restore - generated column - not populating
Date: 2021-05-04 12:25:58
Message-ID: ee108f56-82a7-8a9e-21fd-a9cfc280bee3@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

On 26.04.21 15:40, Peter Eisentraut wrote:
>> I suspect this example is revealing bugs in both the backend
>> (ATTACH PARTITION ought to take care of this, no?) and pg_dump
>> (the backend can't be blamed for pg_dump's choices of columns
>> to dump).  Peter?
>
> The backend side of this would be fixed by the proposed
> <https://www.postgresql.org/message-id/ac35da1c-e746-ea19-bfc3-84819a4e907d%40enterprisedb.com>
> (it's the same code for ALTER TABLE ... INHERIT and ATTACH PARTITION).
>
> The pg_dump side can apparently be fixed by adding
>
> diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c
> index 1a261a5545..c210883ca3 100644
> --- a/src/bin/pg_dump/common.c
> +++ b/src/bin/pg_dump/common.c
> @@ -585,7 +585,7 @@ flagInhAttrs(DumpOptions *dopt, TableInfo *tblinfo,
> int numTables)
>            }
>
>            /* Remove generation expression from child */
> -           if (foundGenerated && !dopt->binary_upgrade)
> +           if (foundGenerated && !dopt->binary_upgrade &&
> !tbinfo->ispartition)
>                tbinfo->attrdefs[j] = NULL;
>        }
>    }
>
> Looks like this was accidentally broken by the last minor release's
> fixes in this area.

Both of these issues have been fixed and will be in the next minor releases.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-05-04 13:59:21 Re: BUG #16991: regclass is not case sensitive causing "relation does not exist" error
Previous Message PG Bug reporting form 2021-05-04 10:53:56 BUG #16991: regclass is not case sensitive causing "relation does not exist" error

Browse pgsql-general by date

  From Date Subject
Next Message Turritopsis Dohrnii Teo En Ming 2021-05-04 14:24:48 How to Host Multiple Mail Domains (Email Hosting) in iRedMail Full Featured Linux Mail Server
Previous Message Thomas Munro 2021-05-04 10:42:17 Re: Huge performance penalty with parallel queries in Windows x64 v. Linux x64