pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: kes-kes@yandex.ru, PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Subject: Re: BUG #15646: Inconsistent behavior for current_setting/set_config
Date: Wed, 20 Feb 2019 13:51:57 -0500
Message-ID: <2247b773-fe5a-c08a-5655-5dff35be2954@joeconway.com> (raw)
In-Reply-To: <16698.1550682675@sss.pgh.pa.us>
References: <15646-0d3caee9f6266f60@postgresql.org>
	<d2ac387b-e796-e3ef-10e5-e06fede7c973@joeconway.com>
	<16698.1550682675@sss.pgh.pa.us>

On 2/20/19 12:11 PM, Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
>> On 2/20/19 11:10 AM, PG Bug reporting form wrote:
>>> But current behavior returns empty string instead of NULL (the initial
>>> value) after transaction is rolled back. When I restart session, NULL is
>>> returned again as it is expected.
> 
>> This has been discussed before and dismissed:
>> https://www.postgresql.org/message-id/flat/56842412.5000005%40joeconway.com
>> Personally I agree it is a bug, but I am not sure you will get much
>> support for that position.
> 
> The fact that we allow undeclared user-defined GUCs at all is a bug IMO.
> We need to find a way to replace that behavior with something whereby
> the name and type of a parameter are declared up-front before you can
> set it.

(moving to hackers)

Perhaps we could do something like:

1. If the user-defined GUC is defined in postgresql.conf, et al, same
   behavior as now
2. Backward compatibility concerns would be an issue, so create another
   new GUC declare_custom_settings which initially defaults to false.
3. If declare_custom_settings is true, and the user-defined GUC is not
   defined in postgresql.conf, then in order to create it dynamically
   via SET or similar methods, you must do something like:

  CREATE SETTING name TYPE guctype [LIST];
  SET name TO value;


Joe

-- 
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development

Attachments:

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

view thread (9+ messages)  latest in thread

Message-ID: <2247b773-fe5a-c08a-5655-5dff35be2954@joeconway.com>
Permalink:  ../2247b773-fe5a-c08a-5655-5dff35be2954@joeconway.com/
Also on:    postgresql.org/message-id/2247b773-fe5a-c08a-5655-5dff35be2954@joeconway.com

 · 

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-bugs@postgresql.org
  Cc: mail@joeconway.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgreSQL.org
  Subject: Re: BUG #15646: Inconsistent behavior for current_setting/set_config
  In-Reply-To: <2247b773-fe5a-c08a-5655-5dff35be2954@joeconway.com>
  References: <15646-0d3caee9f6266f60@postgresql.org> <d2ac387b-e796-e3ef-10e5-e06fede7c973@joeconway.com> <16698.1550682675@sss.pgh.pa.us> <2247b773-fe5a-c08a-5655-5dff35be2954@joeconway.com>

* 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