pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Unlogged sequences
Date: Thu, 07 Apr 2022 14:24:42 +0000
Message-ID: <E1ncT3x-000kQ2-My@gemulon.postgresql.org> (raw)

Unlogged sequences

Add support for unlogged sequences.  Unlike for unlogged tables, this
is not a performance feature.  It allows sequences associated with
unlogged tables to be excluded from replication.

A new subcommand ALTER SEQUENCE ... SET LOGGED/UNLOGGED is added.

An identity/serial sequence now automatically gets and follows the
persistence level (logged/unlogged) of its owning table.  (The
sequences owned by temporary tables were already temporary through the
separate mechanism in RangeVarAdjustRelationPersistence().)  But you
can still change the persistence of an owned sequence separately.
Also, pg_dump and pg_upgrade preserve the persistence of existing
sequences.

Discussion: https://www.postgresql.org/message-id/flat/04e12818-2f98-257c-b926-2845d74ed04f%402ndquadrant.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/344d62fb9a978a72cf8347f0369b9ee643fd0b31

Modified Files
--------------
doc/src/sgml/ref/alter_sequence.sgml       | 12 ++++++
doc/src/sgml/ref/alter_table.sgml          |  6 +++
doc/src/sgml/ref/create_sequence.sgml      | 23 ++++++++++-
doc/src/sgml/ref/create_table.sgml         |  5 +++
doc/src/sgml/ref/pg_dump.sgml              |  7 ++--
src/backend/commands/sequence.c            | 58 ++++++++++++++++++++++++----
src/backend/commands/tablecmds.c           | 32 ++++++++++++++--
src/backend/parser/parse_utilcmd.c         |  1 +
src/bin/pg_dump/pg_dump.c                  | 15 +++++++-
src/bin/psql/describe.c                    |  8 +++-
src/bin/psql/tab-complete.c                |  5 ++-
src/include/commands/sequence.h            |  1 +
src/test/recovery/t/014_unlogged_reinit.pl | 61 +++++++++++++++++++++++++++---
src/test/regress/expected/alter_table.out  |  4 +-
src/test/regress/expected/sequence.out     | 20 +++++++++-
src/test/regress/sql/sequence.sql          | 10 ++++-
16 files changed, 237 insertions(+), 31 deletions(-)



Message-ID: <E1ncT3x-000kQ2-My@gemulon.postgresql.org>
Permalink:  ../E1ncT3x-000kQ2-My@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ncT3x-000kQ2-My@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org
  Subject: Re: pgsql: Unlogged sequences
  In-Reply-To: <E1ncT3x-000kQ2-My@gemulon.postgresql.org>
  References: <E1ncT3x-000kQ2-My@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox