unlogged sequences

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: unlogged sequences
Date: 2019-06-20 07:30:34
Message-ID: 04e12818-2f98-257c-b926-2845d74ed04f@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The discussion in bug #15631 revealed that serial/identity sequences of
temporary tables should really also be temporary (easy), and that
serial/identity sequences of unlogged tables should also be unlogged.
But there is no support for unlogged sequences, so I looked into that.

If you copy the initial sequence relation file to the init fork, then
this all seems to work out just fine. Attached is a patch. The
low-level copying seems to be handled quite inconsistently across the
code, so I'm not sure what the most appropriate way to do this would be.
I'm looking for feedback from those who have worked on tableam and
storage manager to see what the right interfaces are or whether some new
interfaces might perhaps be appropriate.

(What's still missing in this patch is ALTER SEQUENCE SET
{LOGGED|UNLOGGED} as well as propagating the analogous ALTER TABLE
command to owned sequences.)

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
v1-0001-Make-command-order-in-test-more-sensible.patch text/plain 1.8 KB
v1-0002-Fix-comment.patch text/plain 2.0 KB
v1-0003-Unlogged-sequences.patch text/plain 9.3 KB
v1-0004-Make-identity-serial-sequences-unlogged-when-thei.patch text/plain 1.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo Nagata 2019-06-20 07:44:10 Re: Implementing Incremental View Maintenance
Previous Message Dean Rasheed 2019-06-20 07:08:44 Re: Multivariate MCV list vs. statistics target