Explicitly setting sequence next value, removes ownership of table of a serial

Поиск
Список
Период
Сортировка
От Regina Obe
Тема Explicitly setting sequence next value, removes ownership of table of a serial
Дата
Msg-id 004c01d93cd8$7a0f8420$6e2e8c60$@pcorp.us
обсуждение исходный текст
Ответы Re: Explicitly setting sequence next value, removes ownership of table of a serial  (Aditya Toshniwal <aditya.toshniwal@enterprisedb.com>)
Список pgadmin-hackers
I noticed something which might be intentional, but seems odd.

If I do something like:

CREATE TABLE test(id serial, name text);

And then I use the pgAdmin UI to edit the current value of the sequence.
I notice it does this:

ALTER SEQUENCE IF EXISTS public.test_id_seq OWNED BY NONE; 
SELECT setval('public.test_id_seq', 2, true);


So then dropping the table, will not drop the sequence.

If I create a table with the generated syntax:

CREATE TABLE test(id integer GENERATED BY DEFAULT AS IDENTITY, name text);

Then go edit, it doesn't try to drop the ownership, just does this

SELECT setval('public.test_id_seq', 2, true);

Is there a reason why pgAdmin drops the ownership?

Thanks,
Regina








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

Предыдущее
От: Akshay Joshi
Дата:
Сообщение: pgAdmin 4 v6.20 Released
Следующее
От: Aditya Toshniwal
Дата:
Сообщение: Re: Explicitly setting sequence next value, removes ownership of table of a serial