On 03.04.22 20:50, David G. Johnston wrote:
> However, tables having an identity sequence seem to be unaddressed in
> this patch. The existing (and unchanged) pg_dump.c code results in:
It is addressed. For example, run this in PG14:
create unlogged table t1 (a int generated always as identity, b text);
Then dump it with PG15 with this patch:
CREATE UNLOGGED TABLE public.t1 (
a integer NOT NULL,
b text
);
ALTER TABLE public.t1 OWNER TO peter;
--
-- Name: t1_a_seq; Type: SEQUENCE; Schema: public; Owner: peter
--
ALTER TABLE public.t1 ALTER COLUMN a ADD GENERATED ALWAYS AS IDENTITY (
SEQUENCE NAME public.t1_a_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
ALTER SEQUENCE public.t1_a_seq SET LOGGED;