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...