public inbox for [email protected]
help / color / mirror / Atom feedFrom: Ron Johnson <[email protected]>
To: [email protected] <[email protected]>
Subject: Re: order of pg_dump command "create sequence"
Date: Fri, 6 Jun 2025 10:07:47 -0400
Message-ID: <CANzqJaB+nyci9jK-ttnT=0rjhGotCzb-6fpoGKufzSxCimTC9A@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>
On Fri, Jun 6, 2025 at 9:54 AM David G. Johnston <[email protected]>
wrote:
> 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.
>
It's too bad that the server, when it sees the CREATE FUNCTION DDL, can't
notice the obvious (to humans) not-immutable nature of the function and
throw a warning. It would certainly be hideously complex code, though, and
miss lots of cases while throwing some false positive messages.
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
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: order of pg_dump command "create sequence"
In-Reply-To: <CANzqJaB+nyci9jK-ttnT=0rjhGotCzb-6fpoGKufzSxCimTC9A@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