Re: Questions about the new subscription parameter: password_required - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Questions about the new subscription parameter: password_required
Date
Msg-id cf7c8ed9e2da20e7bd0de6362cb342d2a1492074.camel@j-davis.com
Whole thread Raw
In response to Re: Questions about the new subscription parameter: password_required  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Questions about the new subscription parameter: password_required
List pgsql-hackers
On Fri, 2023-09-22 at 08:36 -0400, Robert Haas wrote:
> On Fri, Sep 22, 2023 at 4:25 AM Benoit Lobréau
> <benoit.lobreau@dalibo.com> wrote:
> > Can we consider adding something like this to clarify?
> >
> > """
> > This parameter is enforced when the CREATE SUBSCRIPTION or ALTER
> > SUBSCRIPTION .. CONNECTION commands are executed. Therefore, it's
> > possible to alter the ownership of a subscription with
> > password_required=true to a non-superuser.
> > """
>
> I'm not sure of the exact wording, but there was another recent
> thread
> complaining about this being unclear, so it seems like some
> clarification is needed.

IIUC there is really one use case here, which is for superuser to
define a subscription including the connection, and then change the
owner to a non-superuser to actually run it (without being able to
touch the connection string itself). I'd just document that in its own
section, and mention a few caveats / mistakes to avoid. For instance,
when the superuser is defining the connection, don't forget to set
password_required=false, so that when you reassign to a non-superuser
then the connection doesn't break.

Regards,
    Jeff Davis




pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Failures on gombessa -- EIO?
Next
From: Peter Geoghegan
Date:
Subject: nbtree's ScalarArrayOp array mark/restore code appears to be buggy