Re: order of pg_dump command "create sequence" - Mailing list pgsql-admin

From Антон Глушаков
Subject Re: order of pg_dump command "create sequence"
Date
Msg-id CAHnOmafoGRUPrCpK1twGQYEE10VjJGW80zt9nvd1gbbT8Dk_Aw@mail.gmail.com
Whole thread Raw
In response to Re: order of pg_dump command "create sequence"  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: order of pg_dump command "create sequence"
List pgsql-admin
I absolutely agree.
Unfortunately, Postgres does not check the function code to see if it is really immutable

пт, 6 июн. 2025 г. в 16:54, David G. Johnston <david.g.johnston@gmail.com>:
On Friday, June 6, 2025, Антон Глушаков <a.glushakov86@gmail.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.

pgsql-admin by date:

Previous
From: Антон Глушаков
Date:
Subject: Re: order of pg_dump command "create sequence"
Next
From: Christoph Berg
Date:
Subject: Re: Replication and Switchover