Re: pg_sequence_last_value() for unlogged sequences on standbys

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Date: 2024-05-01T02:05:31Z
Lists: pgsql-hackers

Attachments

On Tue, Apr 30, 2024 at 08:13:17PM -0500, Nathan Bossart wrote:
> Good point.  I'll work on a patch along these lines, then.

This ended up being easier than I expected.  While unlogged sequences are
only supported on v15 and above, temporary sequences have been around since
v7.2, so this will probably need to be back-patched to all supported
versions.  The added test case won't work for v12-v14 since it uses an
unlogged sequence.  I'm not sure it's worth constructing a test case for
temporary sequences.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

Commits

  1. Remove redundant privilege check from pg_sequences system view.

  2. Fix pg_sequence_last_value() for unlogged sequences on standbys.