Re: pg_restore - generated column - not populating

From: Santosh Udupi <email(at)hitha(dot)net>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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 15:08:13
Message-ID: CACLRvHY7LgZspLyUbs9JWyFKoWL0+GTk1JzVx5y0V1COoC2s+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

Thank you so much!!

On Tue, May 4, 2021 at 5:26 AM Peter Eisentraut <
peter(dot)eisentraut(at)enterprisedb(dot)com> wrote:

> 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

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2021-05-04 16:26:53 Re: ALTER CONSTRAINT on a partitioned FK isn't working
Previous Message Federico Caselli 2021-05-04 14:43:00 RE: BUG #16991: regclass is not case sensitive causing "relation does not exist" error

Browse pgsql-general by date

  From Date Subject
Next Message Hans Buschmann 2021-05-04 15:50:39 AW: Huge performance penalty with parallel queries in Windows x64 v. Linux x64
Previous 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