Re: warn if GUC set to an invalid shared library

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Maciek Sakrejda <m(dot)sakrejda(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Cary Huang <cary(dot)huang(at)highgo(dot)ca>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: warn if GUC set to an invalid shared library
Date: 2022-10-31 13:31:20
Message-ID: 20221031133120.GO16921@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Oct 30, 2022 at 04:12:33PM -0700, Maciek Sakrejda wrote:
> On Sat, Oct 29, 2022 at 10:40 AM Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:
> >
> > On Fri, Sep 02, 2022 at 05:24:58PM -0500, Justin Pryzby wrote:
> > > It caused no issue when I changed:
> > >
> > > /* Check that it's acceptable for the indicated parameter */
> > > if (!parse_and_validate_value(record, name, value,
> > > - PGC_S_FILE, ERROR,
> > > + PGC_S_TEST, ERROR,
> > > &newval, &newextra))
> > >
> > > I'm not sure where to go from here.
> >
> > I'm hoping for some guidance ; this simple change may be naive, but I'm not
> > sure what a wider change would look like.
>
> I assume you mean guidance on implementation details here, and not on

ALTER SYSTEM tests the new/proposed setting using PGC_S_FILE ("which is
a lie").

It seems better to address that lie before attempting to change the
behavior of *_preload_libraries.

PGC_S_TEST is a better fit, so my question is whether it's really that
simple ?

> Also, for what it's worth, I think requiring the libraries to be in
> place before running ALTER SYSTEM does not really seem that onerous. I
> can't really think of use cases it precludes.

Right now, it's allowed to set the GUC before installing the shlib.
That's a supported case (see the 11 month old messages toward the
beginning of this thread).

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-10-31 13:41:45 Re: doc: Fix description of how the default user name is chosen
Previous Message Aleksander Alekseev 2022-10-31 13:28:22 Re: Adding doubly linked list type which stores the number of items in the list