Re: order of pg_dump command "create sequence"

From: Антон Глушаков <a(dot)glushakov86(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: order of pg_dump command "create sequence"
Date: 2025-06-06 15:09:04
Message-ID: CAHnOmafoGRUPrCpK1twGQYEE10VjJGW80zt9nvd1gbbT8Dk_Aw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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(dot)g(dot)johnston(at)gmail(dot)com>:

> 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.
>
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Christoph Berg 2025-06-06 15:09:21 Re: Replication and Switchover
Previous Message Антон Глушаков 2025-06-06 15:07:22 Re: order of pg_dump command "create sequence"