public inbox for [email protected]  
help / color / mirror / Atom feed
From: Celia McInnis <[email protected]>
To: pgsql-generallists.postgresql.org <[email protected]>
Subject: is there an immutable function to switch from date to character?
Date: Wed, 24 Apr 2024 17:31:00 -0400
Message-ID: <CAGD6t7+GykxBs=BVeg2un_rQOrjXz==pXt-UWFVTNCgeYCSB5A@mail.gmail.com> (raw)

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


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: is there an immutable function to switch from date to character?
  In-Reply-To: <CAGD6t7+GykxBs=BVeg2un_rQOrjXz==pXt-UWFVTNCgeYCSB5A@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