Re: let's make the list of reportable GUCs configurable (was Re: Add %r substitution for psql prompts to show recovery status)

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Dave Cramer <pg(at)fastcrypt(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>, Ian Barwick <ian(dot)barwick(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: let's make the list of reportable GUCs configurable (was Re: Add %r substitution for psql prompts to show recovery status)
Date: 2019-11-05 14:06:44
Message-ID: 194766cb-c218-2831-5a73-1304b1c697b9@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-10-12 05:05, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
>> On 2019-10-11 16:30:17 -0400, Robert Haas wrote:
>>> But, if it does need to be changed, it seems like a terrible idea to
>>> allow it to be done via SQL. Otherwise, the user can break the driver
>>> by using SQL to set the list to something that the driver's not
>>> expecting, and there's nothing the driver can do to prevent it.
>
>> Uhm. The driver can just ignore GUCs it's not interested in, like our
>> docs have told them for a long time?
>
> Certainly it should do that; but the problematic case is where it
> *doesn't* get told about something it's depending on knowing about.

Yeah, the problem I see here is this: Client 1 uses language driver A,
client 2 uses language driver B. Connection pooling is in use, and they
both connect to the same pool. Everyone is happy.

Now this feature gets introduced. Language driver A is updated to
transparently ask for GUC "foo" to be reported, because it uses it
internally. Now how it connection pooling supposed to work in this
situation?

There either needs to be a way to change reported parameters during a
session that this can be run when an existing backend connection is
assigned to a pooler client. Or the connection pooler would need to be
changed to create separate pools for each different setting of the
to-be-reported list, just like it already creates separate pools for
different users and databases, since you can't change those after
session start either. Both of these options are not without problems.
We should have a complete plan for this before implementing the feature
in the server.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2019-11-05 14:11:32 Re: v12 and pg_restore -f-
Previous Message Peter Eisentraut 2019-11-05 13:47:37 Re: v12 and pg_restore -f-