On Friday, June 6, 2025, Антон Глушаков <a(dot)glushakov86(at)gmail(dot)com> wrote:
>
> /* create a function that will move the sequence */
> CREATE FUNCTION public.gen_id() RETURNS character varying
> LANGUAGE sql IMMUTABLE AS
> $$
> SELECT 'PREFIX_'||nextval('public.my_seq'::regclass)::VARCHAR;
> $$;
>
>
>
Stating immutable is a lie and the breakage is on your head for violating
using only immutable functions in generated expressions.
David J.