altering a column to to make it generated

From: Celia McInnis <celia(dot)mcinnis(at)gmail(dot)com>
To: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: altering a column to to make it generated
Date: 2024-04-22 19:42:09
Message-ID: CAGD6t7L68jXK6jOLHhyRijSE1y-Y_pic9RZaNyBG+-QY4pa=6Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Can I alter a table column to now make it generated? I tried this
unsuccessfully:

create temp table tmp1 as select 15::numeric(6,1) as
distance,'24:30'::interval,0::numeric(7,3) as avgspd;
alter table tmp1 alter column avgspd type numeric(7,3) generated always as
((3600.*distance)/EXTRACT (EPOCH FROM rdrtime::interval)) STORED;
ERROR: syntax error at or near "generated"
LINE 1: ... table tmp1 alter column avgspd type numeric(7,3) generated ...

I think that at least I have the right bracketing this time! :-)
^

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2024-04-22 19:45:46 Re: altering a column to to make it generated
Previous Message Adrian Klaver 2024-04-22 19:14:38 Re: CLUSTER vs. VACUUM FULL