is there an immutable function to switch from date to character?

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: is there an immutable function to switch from date to character?
Date: 2024-04-24 21:31:00
Message-ID: CAGD6t7+GykxBs=BVeg2un_rQOrjXz==pXt-UWFVTNCgeYCSB5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

create temporary table junk as select now()::date as evtdate;

alter table junk add column chardate text GENERATED ALWAYS AS
(to_char(evtdate,'YYYY-Mon-DD')) STORED;

ERROR: generation expression is not immutable

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Baldwin 2024-04-24 21:35:50 Re: is there an immutable function to switch from date to character?
Previous Message Adrian Klaver 2024-04-24 15:10:52 Re: Backup_Long Running