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

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Peter Eisentraut <peter(dot)eisentraut(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: 2018-01-10 21:30:32
Message-ID: CA+TgmoZXj2QGvwvDrhT16K1XcE7s3vSYy1vfBB3DJ8LudQsT3w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 10, 2018 at 3:55 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> But if we add this feature and somebody wants to use it for
>> server_version_num, it's really pretty simple. In the startup packet,
>> you say _pq_.report=server_version_num. Then, you call
>> PQparameterStatus(conn, "server_version_num"). If you don't get a
>> value, you try calling PQparameterStatus(conn, "server_version") and
>> extracting the second word. If that still doesn't work then you give
>> up. That doesn't seem either useless or difficult to implement
>> correctly from here.
>
> Yeah, but what's the point? If yuou have to maintain the server_version
> parsing code anyway, you're not saving any complexity with this. You're
> just creating a code backwater that you probably won't test adequately.

Well, you obviously don't buy the idea that parsing server_version_num
might be more reliable than parsing server_version. If you did buy
that idea, you might want to use the more-reliable technique when
possible and fall back otherwise, but I think you've made up your mind
about this. Anyway, a proposal like this gets us out of the business
of legislating what Everyone Must Do, which I think can only be a
plus.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2018-01-10 21:31:06 Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)
Previous Message legrand legrand 2018-01-10 21:20:03 Re: AS OF queries