PG Bug reporting form <noreply(at)postgresql(dot)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