BUG #17960: pg_dump does not backup generated columns correctly. - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #17960: pg_dump does not backup generated columns correctly.
Date
Msg-id 17960-1a424b3d6792d769@postgresql.org
Whole thread Raw
Responses Re: BUG #17960: pg_dump does not backup generated columns correctly.
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      17960
Logged by:          Sajjad Hassany Pazoky
Email address:      ijustloveit13@gmail.com
PostgreSQL version: 15.2
Operating system:   Windows
Description:

Hi

Dear are two stackoverflow bugs reported an none had an answer:

https://stackoverflow.com/questions/64600614/restoring-pg-database-from-dump-fails-due-to-generated-columns
https://dba.stackexchange.com/questions/327852/pg-dump-unable-to-produce-a-valid-backup

pg_dump does not wite DEFAULT for generated columns. So, it produces error
when restoring.
The strange part is that when I create the table again, fill it with data
and use pg_dump to bacup, it is correct, but the current table in the
database producecs wrong backup.

I tested this on Postgresql 13, 14, and 15.
I'm available if any assistance is needed.


pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: BUG #17953: Libpq can stall indefinitely with non-tls localhost (127.0.0.1) connection
Next
From: PG Bug reporting form
Date:
Subject: BUG #17961: Incorrect aggregation MIN, AVG, MAX