Re: warn if GUC set to an invalid shared library

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "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>, Maciek Sakrejda <m(dot)sakrejda(at)gmail(dot)com>
Subject: Re: warn if GUC set to an invalid shared library
Date: 2024-11-11 10:09:15
Message-ID: 6f00b453-f716-4e73-93ec-67dd93025746@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I had a quick glance at this, and I agree with Robert's comment earlier
that this requires a lot of context to understand.

Does this change the behavior of what is accepted or not? What are those
cases? Can you give some examples, please?

When do you get the new warnings? Examples please.

Does this require documentation changes?

On 22/07/2024 19:28, Justin Pryzby wrote:
> And added a preparatory patch to distinguish ALTER USER/DATABASE SET
> from SET in a function, to avoid warning in that case.

The comment above enum GucSource needs updating.

PGC_S_TEST_FUNCTION is missing from GucSource_Names (there's a reminder
of this in the comment above enum GucSource). Are there other places
where PGC_S_TEST_FUNCTION is missing?

Do extensions need any changes for this? Consider renaming PGC_S_TEST
too, to intentionally break any code that might now need to also check
for PGC_S_TEST_FUNCTION.

Or perhaps there's a better way to distinguish between ALTER
DATABASE/ROLE and CREATE FUNCTION settings. We already have different
GucSource codes for per-database and per-user settings; I wonder if it
would be better to use those codes and a separate "is_testing" flag.
That would also naturally allow the combination of "source == PGC_S_FILE
&& is_testing==true", if some settings would need different checks in
ALTER SYSTEM for example.

--
Heikki Linnakangas
Neon (https://neon.tech)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2024-11-11 10:12:06 Re: Separate memory contexts for relcache and catcache
Previous Message Hayato Kuroda (Fujitsu) 2024-11-11 09:49:19 RE: Commit Timestamp and LSN Inversion issue