Re: nextval() on serial using old, existing value on insert?

Поиск
Список
Период
Сортировка
От Holger Jakobs
Тема Re: nextval() on serial using old, existing value on insert?
Дата
Msg-id 8234056e-9d60-2a41-1701-1afb08e330db@jakobs.com
обсуждение исходный текст
Ответ на Re: nextval() on serial using old, existing value on insert?  (hubert depesz lubaczewski <depesz@depesz.com>)
Ответы Re: nextval() on serial using old, existing value on insert?  (Doug Reynolds <mav@wastegate.net>)
Список pgsql-admin
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


Вложения

В списке pgsql-admin по дате отправления:

Предыдущее
От: ROHIT SACHDEVA
Дата:
Сообщение: Related To Query Optimization
Следующее
От: Holger Jakobs
Дата:
Сообщение: Re: Related To Query Optimization