Re: adding a generated column to a table?

2024-04-22 Thread Adrian Klaver
On 4/22/24 09:05, Celia McInnis wrote: If I have a table containing a date field, say: create temporary table tmp1 as select now()::date as evtdate; SELECT 1 select DATE_PART('year', evtdate)::integer as year from tmp1;  year --  2024 (1 row) Is there some way of doing something like the

adding a generated column to a table?

2024-04-22 Thread Celia McInnis
If I have a table containing a date field, say: create temporary table tmp1 as select now()::date as evtdate; SELECT 1 select DATE_PART('year', evtdate)::integer as year from tmp1; year -- 2024 (1 row) Is there some way of doing something like the following?: alter table tmp1 add column