GUC parameter ACLs and physical walsender - Mailing list pgsql-hackers

From Jeff Davis
Subject GUC parameter ACLs and physical walsender
Date
Msg-id d8f8e11f06d692fff89e6be0f22732d30cf695a0.camel@j-davis.com
Whole thread
Responses Re: GUC parameter ACLs and physical walsender
List pgsql-hackers
Moving discussion from:

https://www.postgresql.org/message-id/4524ed61a015d3496fc008644dcb999bb31916a7.camel@j-davis.com

because this is a separate issue. If you specify a SUSET GUC setting
when connecting as non-superuser for physical replication:

  PGOPTIONS="-c wal_compression=on" \
  pg_receivewal -D archive -U repl

you get:

  FATAL:  cannot read pg_class without having selected a database

but only if you connect immediately after the server starts. If you do
something else first, like an ordinary connection and "SELECT 1", and
then start the replication connection, you get (after commit
dbf217c1c7):

  FATAL:  permission denied to set parameter "wal_compression"

as expected. The problem goes back to a0ffa885e47.

It seems to be because pg_parameter_acl is not nailed in cache. I
attached a quick patch to do so (which turns it into the "expected
permission denied" error). But I'm not sure if that's the right fix, or
if it would be a complete fix. I also don't think that would be
backportable, but perhaps?

Regards,
    Jeff Davis


Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Startup process deadlock: WaitForProcSignalBarriers vs aux process
Next
From: Nico Williams
Date:
Subject: Re: PostgreSQL 17: Bug in libpq when libpq is dlopened/closed multiple times