From: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: nextval() on serial using old, existing value on insert?
Date: Thu, 11 May 2023 17:09:45 +0200
Message-ID: <8234056e-9d60-2a41-1701-1afb08e330db@jakobs.com> (raw)
In-Reply-To: <ZFzhvT/4cvUTRlF2@depesz.com>
References: <CAOC+FBWAzy8MDbwE2XJGsi8eV=QCuSS8orgAEdyOLr37_Z4ByQ@mail.gmail.com>
<CAKFQuwaV9z4xUoxaqLx0_-7UjaafWX3O0=1Rsu4EDi87PTxUrQ@mail.gmail.com>
<CAOC+FBWNpEvA9mSj3_wfhc2PPpeEr5BBshaN4trbXvgPgep0wQ@mail.gmail.com>
<CAOC+FBVz0MhyA4oUwEHbtvCVQV-Hh9n1esA-1OMMt=N6LZb_Vw@mail.gmail.com>
<ZFzhvT/4cvUTRlF2@depesz.com>
Am 11.05.23 um 14:38 schrieb hubert depesz lubaczewski:
> On Wed, May 10, 2023 at 10:06:28PM -0700, Wells Oliver wrote:
>> As a follow up, I've selected max(common_key) from the table and
>> setval()'ed on the sequence to that +1 and I think that should make this go
>> away. Any reason why that's insane?
> If you're on pg 10 or newer, you can make the id to be "generated always
> as identity" which will make it impossible to provide id value from
> user, thus making the problem impossible to happen.
>
> Best regards,
>
> depesz
Impossible to happen by chance. A malicious user could always use
OVERRIDING SYSTEM VALUE clause.
Kind Regards,
Holger
--
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
Attachments:
[application/pgp-signature] OpenPGP_signature (202B, ../8234056e-9d60-2a41-1701-1afb08e330db@jakobs.com/2-OpenPGP_signature)
download
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: pgsql-admin@postgresql.org
Cc: holger@jakobs.com, pgsql-admin@lists.postgresql.org
Subject: Re: nextval() on serial using old, existing value on insert?
In-Reply-To: <8234056e-9d60-2a41-1701-1afb08e330db@jakobs.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox