Re: pg_restore - generated column - not populating

From: Santosh Udupi <email(at)hitha(dot)net>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: pg_restore - generated column - not populating
Date: 2021-02-23 14:36:26
Message-ID: CACLRvHaB_mLCygA6AQnc5jh+cBme2A-=Su9oDyO4O20k5ZSKSw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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(dot)klaver(at)aklaver(dot)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(dot)klaver(at)aklaver(dot)com
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-02-23 15:12:13 Re: BUG #16888: Reoccurring group by clauses makes system slower
Previous Message Thomas Trenz 2021-02-23 08:11:20 Re: BUG #16874: Postgres Server crashes at commit

Browse pgsql-general by date

  From Date Subject
Next Message Devrim Gündüz 2021-02-23 15:05:23 Re: yum update for postgresql rpms
Previous Message Ron 2021-02-23 14:32:38 Re: yum update for postgresql rpms