Re: Fix search_path for all maintenance commands - Mailing list pgsql-hackers

From Gurjeet Singh
Subject Re: Fix search_path for all maintenance commands
Date
Msg-id CABwTF4WUaofzPX6nGM4Uc4dt4TySh-XXY=6ycmnXsGpyuhpZ-g@mail.gmail.com
Whole thread Raw
In response to Re: Fix search_path for all maintenance commands  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Fix search_path for all maintenance commands
List pgsql-hackers
On Fri, Jun 9, 2023 at 2:00 PM Jeff Davis <pgsql@j-davis.com> wrote:
>
> On Thu, 2023-06-08 at 21:55 -0700, Nathan Bossart wrote:
> > On Thu, Jun 08, 2023 at 06:08:08PM -0400, Greg Stark wrote:
> > > I guess that's pretty narrow and a reasonable thing to desupport.
> > > Users could just mark those functions with search_path or schema
> > > qualify the object references in them. Perhaps we should also be
> > > picking up cases like that sooner so users realize they've created
> > > a
> > > footgun for themselves?
>
> Many cases will be picked up, for instance CREATE INDEX will error if
> the safe search path is not good enough.
>
> > I'm inclined to agree that this is reasonable to desupport.
>
> Committed.

I'm not sure if mine is a valid concern, and it has been a long time
since I looked at the search_path's and switching Role's implications
(CVE-2009-4136) so pardon my ignorance.

It feels a bit late in release cycle to introduce this breaking
change. If they depended on search_path, people and utilities that use
these maintenance commands may see failures. Although I can't think of
a scenario where such a failure may cause an outage, sometimes these
maintenance operations are performed while the users are staring down
the barrel of a gun (imminent danger of running out of space, bad
statistics causing absurd query plans, etc.). So, if not directly, a
failure of these operations may indirectly cause an outage.

I feel more thought needs to be given to the impact of this change,
and we should to give others more time for feedback.

Short of that, it'd be prudent to allow the user to somehow fall back
to old behaviour; a command-line option, or GUC, etc. That way we can
mark the old behaviour "deprecated", with a workaround for those who
may desperately need it, and in another release or so, finally pull
the plug on old behaviour.

My 2bits.

Best regards,
Gurjeet
http://Gurje.et



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: add non-option reordering to in-tree getopt_long
Next
From: Bruce Momjian
Date:
Subject: Re: Let's make PostgreSQL multi-threaded