Re: set_config() documentation clarification

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: Joel Jacobson <joel(at)compiler(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: set_config() documentation clarification
Date: 2021-01-04 15:41:59
Message-ID: 5FF33747.9010603@anastigmatix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/04/21 10:25, Joel Jacobson wrote:
> I just learned from a pg friend, it's possible to set your own made up setting_name using set_config(),
> if the setting_name contains at least one dot ".".

It works that way so you can set a config variable needed by an extension,
if necessary before the extension is loaded, so PostgreSQL doesn't know yet
what variable names with that prefix are or aren't valid. Once the extension
that defines the prefix (before the first dot) is loaded, it will handle
any variables with that prefix that it recognizes, and errors will be
reported for any others.

I'm not sure how much of that behavior needs to be documented for
set_config() itself; it gets a little deep into the weeds of extension
development. Is it documented there? In that case, maybe the briefest
of mentions at set_config() would be appropriate, such as "names starting
with a prefix and a dot can be treated specially, as described at [link]".

Regards,
-Chap

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2021-01-04 15:45:24 Re: PoC/WIP: Extended statistics on expressions
Previous Message Dean Rasheed 2021-01-04 15:34:08 Re: PoC/WIP: Extended statistics on expressions