Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VLRJw-0007vJ-L2 for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Sep 2013 05:26:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VLRJv-00013n-Qd for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Sep 2013 05:25:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VLRJu-00013e-FT for pgsql-hackers@postgresql.org; Mon, 16 Sep 2013 05:25:58 +0000 Received: from mail-pd0-f171.google.com ([209.85.192.171]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VLRJl-0001cR-PZ for pgsql-hackers@postgresql.org; Mon, 16 Sep 2013 05:25:57 +0000 Received: by mail-pd0-f171.google.com with SMTP id g10so3654402pdj.2 for ; Sun, 15 Sep 2013 22:25:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=QMukSD1e5Wq9h8HTjBSH1CpE6KBCeA3rQhRi3usqwog=; b=bgcPDjrlsZSOJo6gWHEYmPUSHImtt63Qc+50lJjOaQLFhc+FL4F89/6fkO06cm0sgS kzpV+VEi57zO5lYRluvPU7z7LfWfxue6+OyBXY8zRTU4kAPcplei2DV+LkHFFZ4PgZ7X StM4VRF3/K/hR+X7p/eDrMkYBBVHoTV6fZi+Jq70U6pk3ZCPZvaGiPrM/YL+6qOugNPR 4Wa/IPXj6lCMk+echibHAnfRbb6MoOXKYGzEjzd9GkNHEtTcFwoNklf+c92fTVEcS8lR ljP5sYWt/p9o+XSJJy5+tVaWnZ0EkWmtQXqAJwl+T2QNwhs0yuO62j5hxQFjD0ulmPkQ tPcw== X-Gm-Message-State: ALoCoQkqhDuoZT6XPUW+wpBN5ceGHtRcROeRjlPCXZsW8YISK1gUz8bqwnNIVyqrMUgWJ+oCbvoW X-Received: by 10.68.172.3 with SMTP id ay3mr16381794pbc.5.1379309147161; Sun, 15 Sep 2013 22:25:47 -0700 (PDT) Received: from [192.168.2.58] (218-42-155-17.cust.bit-drive.ne.jp. [218.42.155.17]) by mx.google.com with ESMTPSA id gg10sm28423179pbc.46.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 15 Sep 2013 22:25:46 -0700 (PDT) Message-ID: <52369651.7000208@uptime.jp> Date: Mon, 16 Sep 2013 14:25:37 +0900 From: Satoshi Nagayasu User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: Tom Lane CC: Andres Freund , Josh Berkus , Fujii Masao , Michael Paquier , Jim Nasby , Greg Stark , Hannu Krosing , Alvaro Herrera , PostgreSQL-development Subject: Re: pg_system_identifier() References: <20130822162019.GC10710@eldon.alvh.no-ip.org> <20130822163059.GI17006@awork2.anarazel.de> <15653.1377189456@sss.pgh.pa.us> <52177AD5.5010809@2ndQuadrant.com> <521A8985.2040509@nasby.net> <521B8C1E.9000808@agliodbs.com> <20130826184546.GB5464@awork2.anarazel.de> <15419.1377549357@sss.pgh.pa.us> In-Reply-To: <15419.1377549357@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Hi, I'm catching up with the discussion as a reviewer... (2013/08/27 5:35), Tom Lane wrote: > Andres Freund 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 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