public inbox for [email protected]  
help / color / mirror / Atom feed
From: Антон Глушаков <[email protected]>
To: David G. Johnston <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: order of pg_dump command "create sequence"
Date: Fri, 6 Jun 2025 18:09:04 +0300
Message-ID: <CAHnOmafoGRUPrCpK1twGQYEE10VjJGW80zt9nvd1gbbT8Dk_Aw@mail.gmail.com> (raw)
In-Reply-To: <CAKFQuwYXJ11+wMu-qrLi9yQwZYjDsgJH=h6aStyxcHti=gYC+g@mail.gmail.com>
References: <CAHnOmadVj0y982EqT9sEvszjcKikysWtSrX88OvknP0W0poDkQ@mail.gmail.com>
	<CAKFQuwYXJ11+wMu-qrLi9yQwZYjDsgJH=h6aStyxcHti=gYC+g@mail.gmail.com>

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 <[email protected]>:

> On Friday, June 6, 2025, Антон Глушаков <[email protected]> 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.
>
>


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], [email protected]
  Subject: Re: order of pg_dump command "create sequence"
  In-Reply-To: <CAHnOmafoGRUPrCpK1twGQYEE10VjJGW80zt9nvd1gbbT8Dk_Aw@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