Re: pg_restore - generated column - not populating
Santosh Udupi <email@hitha.net>
From: Santosh Udupi <email@hitha.net>
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general@lists.postgresql.org
Date: 2021-02-23T14:36:26Z
Lists: pgsql-bugs, pgsql-general
The pg_restore command is actually pg_restore -Ft -d mydb mydb.tar (my mistake). I didn't provide the -h -p -U since I use the super user account to restore (I will try adding them). The restore had always worked until I altered the table in the source database. After I added the column, the restore still takes place but does not populate the generated column. I did a backup using pgAdmin and the restore populated all data using the same syntax on the tar file. So my suspicion is that pg_dump is not doing the dump correctly. I will work on it further. Thanks for your suggestions. On Mon, Feb 22, 2021 at 9:23 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote: > On 2/22/21 7:43 PM, Santosh Udupi wrote: > > If I backup using pgAdmin, I am able to restore using pg_restore but for > > some reason, pg_rsestore on the output from pg_dump does not create > > values for the generated columns > > > > To troubleshoot this: > > 1) Stick to one dump/restore combination. The three versions you tried > before just confuse the issue. For instance: > > pg_dump -Ft mydb > mydb.tar > pg_restore -Ft -d mydb mydb.backup > > makes no sense. As mydb.backup came from: > > pg_dump -C -Fc mydb > mydb.backup > > I have not tested, but I'm pretty sure the pg_restore just ignored the > -Ft and just did -Fc. > > 2) Big explicit in your dump and restore commands for -h(ost), -p(ort) > and -U(ser). I suspect you may not be restoring to where you think you are. > > 3) Closely follow the progress of both the dump and the restore. > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com >
Commits
-
pg_dump: Fix dump of generated columns in partitions
- bdaa0d2d7269 12.7 landed
- a6a3a274abd1 13.3 landed
- feb270d1005f 14.0 landed