Re: BUG #18544: Setting local config_parameter to DEFAULT behaves unexpectedly when using period in config name - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #18544: Setting local config_parameter to DEFAULT behaves unexpectedly when using period in config name
Date
Msg-id 3702824.1721310918@sss.pgh.pa.us
Whole thread Raw
In response to BUG #18544: Setting local config_parameter to DEFAULT behaves unexpectedly when using period in config name  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #18544: Setting local config_parameter to DEFAULT behaves unexpectedly when using period in config name
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #18544: Setting local config_parameter to DEFAULT behaves unexpectedly when using period in config name
Next
From: Hayden Sim
Date:
Subject: Re: BUG #18544: Setting local config_parameter to DEFAULT behaves unexpectedly when using period in config name