From: Satoshi Nagayasu <snaga@uptime.jp>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@2ndquadrant.com>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: Fujii Masao <masao.fujii@gmail.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Jim Nasby <jim@nasby.net>
Cc: Greg Stark <stark@mit.edu>
Cc: Hannu Krosing <hannu@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: pg_system_identifier()
Date: Mon, 16 Sep 2013 14:25:37 +0900
Message-ID: <52369651.7000208@uptime.jp> (raw)
In-Reply-To: <15419.1377549357@sss.pgh.pa.us>
References: <20130822162019.GC10710@eldon.alvh.no-ip.org>
<20130822163059.GI17006@awork2.anarazel.de>
<15653.1377189456@sss.pgh.pa.us>
<52177AD5.5010809@2ndQuadrant.com>
<CAM-w4HMJc+7OCDUFYD=ChWSp6jxBRPContr3Y2Y3py5swwaxig@mail.gmail.com>
<521A8985.2040509@nasby.net>
<CAB7nPqSx+GEROLiCMOYBCDimARQauEe=2TDSZmFEjZYnV6yBKw@mail.gmail.com>
<CAHGQGwH5K9Dm+td00AE9Gwby92fzOJC4mXcjgerYtq+GqxUZhw@mail.gmail.com>
<WM!4a186afed707ebaddcd3a5f21382e12ef6a9d1c73e47f0b5fcf94a69469174a622e24aa2d786ae1c7e4e1f07993de908!@asav-1.01.com>
<521B8C1E.9000808@agliodbs.com>
<20130826184546.GB5464@awork2.anarazel.de>
<15419.1377549357@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Hi,
I'm catching up with the discussion as a reviewer...
(2013/08/27 5:35), Tom Lane wrote:
> Andres Freund <andres@2ndquadrant.com> writes:
>> On 2013-08-26 10:10:54 -0700, Josh Berkus wrote:
>>> I'm going to reverse my vote, and vote against this patch. The reason
>>> why is that I think we should instead have a function:
>>>
>>> pg_controldata(parameter text)
>>>
>>> ... which would report *all* strings in pg_controldata. Hence, you'd do
>>> instead:
>>>
>>> pg_controldata('system identifier')
>>>
>>> This will hopefully spare us from 15 patches incrementally adding all of
>>> the individual items in controldata.
>
>> If anything but the proposed feature, it should be an SRF - passing in
>> text parameters isn't very discoverable.
>
> I'm not pleased with the idea that we'd have to dumb all the relevant
> datatypes down to text so that we could push them through this single
> function.
>
> Also, what about i18n? pg_controldata localizes all the strings it
> prints, but I doubt that's a great idea for either the input or the
> output of this proposed function.
How about adding new system view with new function which returns
a single pg_controldata value in text type, and using a cast for
each column in the view definition?
CREATE VIEW pg_catalog.pg_controldata AS
SELECT pg_controldata('control_version')::integer AS control_version,
pg_controldata('catalog_version')::integer AS catalog_version,
pg_controldata('system_identifier')::bigint AS system_identifier,
...
pg_controldata('next_xlog_file')::char(25) AS next_xlog_file,
...
pg_controldata('encoding')::text AS encoding;
Given that the view can work like a SRF, and it allows us to retrieve
all the values of pg_controldata with appropriate types in single
record from the view:
select * from pg_catalog.pg_controldata;
To get the system identifier value:
select system_identifier from pg_catalog.pg_controldata;
Regards,
--
Satoshi Nagayasu <snaga@uptime.jp>
Uptime Technologies, LLC. http://www.uptime.jp
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: snaga@uptime.jp, tgl@sss.pgh.pa.us, andres@2ndquadrant.com, josh@agliodbs.com, masao.fujii@gmail.com, michael.paquier@gmail.com, jim@nasby.net, stark@mit.edu, hannu@2ndquadrant.com, alvherre@2ndquadrant.com
Subject: Re: pg_system_identifier()
In-Reply-To: <52369651.7000208@uptime.jp>
* 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