public inbox for [email protected]
help / color / mirror / Atom feedRe: v18 virtual columns
2+ messages / 2 participants
[nested] [flat]
* Re: v18 virtual columns
@ 2025-02-20 14:30 Ron Johnson <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Ron Johnson @ 2025-02-20 14:30 UTC (permalink / raw)
To: pgsql-generallists.postgresql.org <[email protected]>
On Thu, Feb 20, 2025 at 8:07 AM Dominique Devienne <[email protected]>
wrote:
> Hi. I've just read
> https://www.dbi-services.com/blog/postgresql-18-virtual-generated-columns/
>
> and I'm wondering whether there will be a way to ALTER existing STORED
> generated columns, to be virtual? W/o rewriting the whole table that is.
>
What about dropping the existing stored column then adding the new virtual
column?
You won't get any disk space saving for existing records, but it's not
going to rewrite the table.
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: v18 virtual columns
@ 2025-02-20 14:33 Dominique Devienne <[email protected]>
parent: Ron Johnson <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Dominique Devienne @ 2025-02-20 14:33 UTC (permalink / raw)
To: Ron Johnson <[email protected]>; +Cc: pgsql-generallists.postgresql.org <[email protected]>
On Thu, Feb 20, 2025 at 3:31 PM Ron Johnson <[email protected]> wrote:
> On Thu, Feb 20, 2025 at 8:07 AM Dominique Devienne <[email protected]>
> wrote:
>
>> Hi. I've just read
>> https://www.dbi-services.com/blog/postgresql-18-virtual-generated-columns/
>>
>> and I'm wondering whether there will be a way to ALTER existing STORED
>> generated columns, to be virtual? W/o rewriting the whole table that is.
>>
>
> What about dropping the existing stored column then adding the new virtual
> column?
>
> You won't get any disk space saving for existing records, but it's not
> going to rewrite the table.
>
Didn't think of that, but yes, I think that would work.
They are GENERATED columns, so the values stored are derived data anyway,
indeed.
I also didn't know DROP COLUMN was smart enough not rewriting the column,
that's good.
Thanks, --DD
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-02-20 14:33 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-02-20 14:30 Re: v18 virtual columns Ron Johnson <[email protected]>
2025-02-20 14:33 ` Dominique Devienne <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox