pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Names of run-time configuration parameters (was: Limiting the operations that client-side code can perform upon its database backend's artifacts)
Date: Sat, 1 Oct 2022 14:05:53 +0200
Message-ID: <20221001120553.b7z7pujnmsllgn5b@hjp.at> (raw)
In-Reply-To: <35254B0B-6501-4CF6-A13F-76D03756C2B2@yugabyte.com>
References: <20220927222637.aolob6gk3kuyirfs@hjp.at>
	<87E125A5-A4B8-4BD6-9E9C-7ABF77650F3F@yugabyte.com>
	<20220928011353.zo7enlnig5vvpowe@jrouhaud>
	<5B23D9B8-56E8-458F-AD3D-B5F88AAB2844@yugabyte.com>
	<20220928025427.coznr3we5plyq5pp@jrouhaud>
	<C1704EC1-487A-4BB0-8301-2530E97F04AA@yugabyte.com>
	<3881881.1664337639@sss.pgh.pa.us>
	<F0A23614-749D-4A89-84C5-119D4000F9FE@yugabyte.com>
	<20220930184515.mw2avsox5daz6yok@hjp.at>
	<35254B0B-6501-4CF6-A13F-76D03756C2B2@yugabyte.com>

On 2022-09-30 17:59:01 -0700, Bryn Llewellyn wrote:
> set rls.tenant_id=42;

This works because there is a "." in the name. Without the "."
PostgreSQL complains:

hjp=> set rls_tenant_id=42;
ERROR:  unrecognized configuration parameter "rls_tenant_id"


I think I sort of knew this but had forgotten about it, so checked the
manual for the exact rules. Unfortunately I couldn't find them (I
checked https://www.postgresql.org/docs/14/sql-set.html,
https://www.postgresql.org/docs/14/config-setting.html,
https://www.postgresql.org/docs/14/functions-admin.html#FUNCTIONS-ADMIN-SET,
and browser the table of content and the index).

From the documentation I get the impression that you can only set
existing parameters, not your own.

I therefore suggest adding something like this to the section
"configuration_parameter" in
https://www.postgresql.org/docs/14/sql-set.html:

| In addition, any name including a single dot (".") can be set. This
| allows an application to define its own run-time parameters. Using the
| application name as a prefix reduces the probability of name conflicts
| with other applications or extensions.

(This of course assumes that the behaviour is intentional and not a
bug.)

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (8+ messages)  latest in thread

Message-ID: <20221001120553.b7z7pujnmsllgn5b@hjp.at>
Permalink:  ../20221001120553.b7z7pujnmsllgn5b@hjp.at/
Also on:    postgresql.org/message-id/20221001120553.b7z7pujnmsllgn5b@hjp.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: hjp-pgsql@hjp.at
  Subject: Re: Names of run-time configuration parameters (was: Limiting the operations that client-side code can perform upon its database backend's artifacts)
  In-Reply-To: <20221001120553.b7z7pujnmsllgn5b@hjp.at>
  References: <20220927222637.aolob6gk3kuyirfs@hjp.at> <87E125A5-A4B8-4BD6-9E9C-7ABF77650F3F@yugabyte.com> <20220928011353.zo7enlnig5vvpowe@jrouhaud> <5B23D9B8-56E8-458F-AD3D-B5F88AAB2844@yugabyte.com> <20220928025427.coznr3we5plyq5pp@jrouhaud> <C1704EC1-487A-4BB0-8301-2530E97F04AA@yugabyte.com> <3881881.1664337639@sss.pgh.pa.us> <F0A23614-749D-4A89-84C5-119D4000F9FE@yugabyte.com> <20220930184515.mw2avsox5daz6yok@hjp.at> <35254B0B-6501-4CF6-A13F-76D03756C2B2@yugabyte.com> <20221001120553.b7z7pujnmsllgn5b@hjp.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox