Re: pg_restore - generated column - not populating

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Santosh Udupi <email(at)hitha(dot)net>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: pg_restore - generated column - not populating
Date: 2021-02-23 01:16:48
Message-ID: 9881df8c-f88e-977e-f222-adb04ba1ec80@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

On 2/22/21 5:08 PM, Santosh Udupi wrote:
> Hi all,
>
> My database has tables with generated columns. I altered a table and
> added a generated column as below:
>
> alter table billing add primary_bill_to_id int   GENERATED ALWAYS as
> ((info->>'vp')::int) stored
>
>
> Now, when I do the pg_dump and pg_restore, this column does not get
> populated. It remains null
>
> "Info" is the jsonb column in the table and info->>'vp' has values in
> multiple rows but still generated column "primary_bill_to_id" is null
> after the restore
>
> I am using postgres version 13
>
> Can you tell me what am I missing?

Without the commands you used to do the dump and restore it will be
difficult to come to any conclusions. It would also be helpful to look
at the Postgres logs from the restore to see if there are any error
messages.

>
> Thank you for your help.
> Santosh
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Santosh Udupi 2021-02-23 01:57:36 Re: pg_restore - generated column - not populating
Previous Message Santosh Udupi 2021-02-23 01:08:17 pg_restore - generated column - not populating

Browse pgsql-general by date

  From Date Subject
Next Message Santosh Udupi 2021-02-23 01:57:36 Re: pg_restore - generated column - not populating
Previous Message Santosh Udupi 2021-02-23 01:08:17 pg_restore - generated column - not populating