Re: unlogged sequences - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: unlogged sequences
Date
Msg-id e4b6b41e-bace-beb1-fa3c-1d25442e51d6@enterprisedb.com
Whole thread Raw
In response to Re: unlogged sequences  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: unlogged sequences  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: unlogged sequences  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
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;



pgsql-hackers by date:

Previous
From: Michael Banck
Date:
Subject: Re: PATCH: add "--config-file=" option to pg_rewind
Next
From: Tomas Vondra
Date:
Subject: Re: logical decoding and replication of sequences