pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: haydenwillsim@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18544: Setting local config_parameter to DEFAULT behaves unexpectedly when using period in config name
Date: Thu, 18 Jul 2024 09:55:18 -0400
Message-ID: <3702824.1721310918@sss.pgh.pa.us> (raw)
In-Reply-To: <18544-60e74dd413b155f1@postgresql.org>
References: <18544-60e74dd413b155f1@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> When a connection is initialised, calling `SELECT
> current_setting('hasura.user', 't');`, as expected will return a NULL.
> However if you call `SET "hasura.user" TO DEFAULT;`, this will actually
> intitialise the value to an empty string. 

That's a side effect of SET causing such a custom GUC to spring
into existence --- with an empty-string default, because there
is no better value.

> This presents a huge problem,

If you don't like it, don't use custom GUCs.  They're not officially
supported --- the only reason this is allowed at all is to allow
setting of an extension's GUCs before the extension is loaded.
See

https://www.postgresql.org/docs/current/runtime-config-custom.html

			regards, tom lane





view thread (7+ messages)  latest in thread

Message-ID: <3702824.1721310918@sss.pgh.pa.us>
Permalink:  ../3702824.1721310918@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3702824.1721310918@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, haydenwillsim@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18544: Setting local config_parameter to DEFAULT behaves unexpectedly when using period in config name
  In-Reply-To: <3702824.1721310918@sss.pgh.pa.us>

* 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