Re: [BUGS] BUG #14813: pg_get_serial_sequence does not return seqencename for IDENTITY columns

Поиск
Список
Период
Сортировка
От zambak zambak
Тема Re: [BUGS] BUG #14813: pg_get_serial_sequence does not return seqencename for IDENTITY columns
Дата
Msg-id CAEy4EGV+xz06Oh82scx4oDeuoM_9N=RV748X0xs5_9L2Qnpx1w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [BUGS] BUG #14813: pg_get_serial_sequence does not return seqencename for IDENTITY columns  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs


On Tue, Sep 12, 2017 at 5:54 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Tue, Sep 12, 2017 at 2:20 PM, <zam6ak@gmail.com> wrote:
The following bug has been logged on the website:

Bug reference:      14813
Logged by:          zam zam
Email address:      zam6ak@gmail.com
PostgreSQL version: 10beta4
Operating system:   windows
Description:

Function pg_get_serial_sequence returns NULL on columns defined as
IDENTITY

CREATE TABLE IF NOT EXISTS public.test (
    id     bigint  NOT NULL GENERATED ALWAYS AS IDENTITY,
    code   text,

    CONSTRAINT test_pk   PRIMARY KEY (id)
)

SELECT pg_get_serial_sequence('public.test', 'id'); -- returns NULL instead
of 'test_id_seq'!

​I suspect this is an opportunity for documentation enhancement as opposed to a bug.

​The CREATE TABLE docs say that: "It will have an implicit sequence attached to it."  I take the word "implicit" to mean that an actual external sequence object is not created.

David J.

But the sequence 'test_id_seq' is created....
To my understanding (and I may be wrong), identity columns are backed by sequences in PG 10...

 

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: [BUGS] BUG #14813: pg_get_serial_sequence does not return seqencename for IDENTITY columns
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [BUGS] BUG #14795: date format not ISO 8601