Re: Show VIRTUAL keyword for virtual generated columns in pg_dump and psql
Lakshmi N <lakshmin.jhs@gmail.com>
From: Lakshmi N <lakshmin.jhs@gmail.com>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>, "dean.a.rasheed@gmail.com" <dean.a.rasheed@gmail.com>,
"peter@eisentraut.org" <peter@eisentraut.org>
Date: 2026-04-13T20:49:12Z
Lists: pgsql-hackers
Attachments
- 0001-Fix-psql-d-to-show-VIRTUAL-keyword-for-generated-col.patch (application/octet-stream) patch 0001
Hi, On Mon, Apr 13, 2026 at 5:27 AM David G. Johnston < david.g.johnston@gmail.com> wrote: > On Monday, April 13, 2026, Lakshmi N <lakshmin.jhs@gmail.com> wrote: >> >> pg_dump and psql's \d currently display stored and virtual generated >> columns asymmetrically: >> > >> >> s_total integer GENERATED ALWAYS AS ((a + b)) STORED >> v_total integer GENERATED ALWAYS AS ((a + b)) >> >> Since VIRTUAL is default most likely this was omitted but with this >> > puts the burden on the reader to identify whether it is STORED or >> VIRTUAL since both kinds coexist in v19. >> > > The output follows existing conventions of not printing extraneous text. > Additionally, storage itself is non-standard so the absence of a modifier > is producing standard-compliant output. I would -1 changing pg_dump on > this basis. I’d be inclined to go with the symmetry/readability argument > for psql \d though. > Thank you for the feedback! Updated the patch for psql \d only. Regards, Lakshmi