Re: altering a column to to make it generated

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: altering a column to to make it generated
Дата
Msg-id d0ad6c95-84c3-4c83-a423-d91d3b0cbfc1@aklaver.com
обсуждение исходный текст
Ответ на altering a column to to make it generated  (Celia McInnis <celia.mcinnis@gmail.com>)
Список pgsql-general
On 4/22/24 12:42, Celia McInnis wrote:
> 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! :-) 

See David Johnston's comment. I keep on wanting to believe that ALTER 
TABLE supports GENERATED expressions, when it only supports GENERATED 
IDENTITY:)

>                                                       
> 
> 
> 
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com




В списке pgsql-general по дате отправления:

Предыдущее
От: Ron Johnson
Дата:
Сообщение: Re: CLUSTER vs. VACUUM FULL
Следующее
От: Tom Lane
Дата:
Сообщение: Re: altering a column to to make it generated