pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Subject: Re: pg_sequence_last_value() for unlogged sequences on standbys
Date: Fri, 3 May 2024 15:49:08 -0500
Message-ID: <20240503204908.GA1737291@nathanxps13> (raw)
In-Reply-To: <ZjG5ia8R_001EvYx@paquier.xyz>
References: <20240501005730.GA594666@nathanxps13>
	<1846474.1714525564@sss.pgh.pa.us>
	<20240501011317.GC594666@nathanxps13>
	<20240501020531.GA721953@nathanxps13>
	<ZjG5ia8R_001EvYx@paquier.xyz>

On Wed, May 01, 2024 at 12:39:53PM +0900, Michael Paquier wrote:
> However, it seems to me that you should also drop the
> pg_is_other_temp_schema() in system_views.sql for the definition of
> pg_sequences.  Doing that on HEAD now would be OK, but there's nothing
> urgent to it so it may be better done once v18 opens up.  Note that
> pg_is_other_temp_schema() is only used for this sequence view, which
> is a nice cleanup.

IIUC this would cause other sessions' temporary sequences to appear in the
view.  Is that desirable?

> By the way, shouldn't we also change the function to return NULL for a
> failed permission check?  It would be possible to remove the
> has_sequence_privilege() as well, thanks to that, and a duplication
> between the code and the function view.  I've been looking around a
> bit, noticing one use of this function in check_pgactivity (nagios
> agent), and its query also has a has_sequence_privilege() so returning
> NULL would simplify its definition in the long-run.  I'd suspect other
> monitoring queries to do something similar to bypass permission
> errors.

I'm okay with that, but it would be v18 material that I'd track separately
from the back-patchable fix proposed in this thread.

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





view thread (19+ messages)  latest in thread

Message-ID: <20240503204908.GA1737291@nathanxps13>
Permalink:  ../20240503204908.GA1737291@nathanxps13/
Also on:    postgresql.org/message-id/20240503204908.GA1737291@nathanxps13

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, michael@paquier.xyz, tgl@sss.pgh.pa.us
  Subject: Re: pg_sequence_last_value() for unlogged sequences on standbys
  In-Reply-To: <20240503204908.GA1737291@nathanxps13>

* 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