Re: pg_restore - generated column - not populating

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Santosh Udupi <email@hitha.net>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Adrian Klaver <adrian.klaver@aklaver.com>, pgsql-bugs@lists.postgresql.org
Date: 2021-02-24T01:03:06Z
Lists: pgsql-bugs, pgsql-general

Attachments

[ redirecting to pgsql-bugs ]

Santosh Udupi <email@hitha.net> writes:
> Here is my table structure.

Indeed, this looks pretty busted, both in v13 and HEAD.  It seems that
pg_dump is not coping well with GENERATED columns attached to a
partition parent table.  I made the attached script with a bit of
sample data, loaded it into an empty database, and dumped it.
The dump is evidently assuming that ALTER TABLE ATTACH PARTITION
is going to cause the generated-ness of the columns to propagate
to the children, but it doesn't.  There also seems to be considerable
confusion about which columns of the child tables should be included
in the dumped data.

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?

			regards, tom lane

Commits

  1. pg_dump: Fix dump of generated columns in partitions