public inbox for [email protected]
help / color / mirror / Atom feedFrom: Celia McInnis <[email protected]>
To: pgsql-generallists.postgresql.org <[email protected]>
Subject: altering a column to to make it generated
Date: Mon, 22 Apr 2024 15:42:09 -0400
Message-ID: <CAGD6t7L68jXK6jOLHhyRijSE1y-Y_pic9RZaNyBG+-QY4pa=6Q@mail.gmail.com> (raw)
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! :-)
^
view thread (3+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: altering a column to to make it generated
In-Reply-To: <CAGD6t7L68jXK6jOLHhyRijSE1y-Y_pic9RZaNyBG+-QY4pa=6Q@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox