Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZrkvZ-0008BK-Ml for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Oct 2015 10:59:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZrkvZ-00043R-8H for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Oct 2015 10:59:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZrkvY-00043K-J0 for pgsql-hackers@postgresql.org; Thu, 29 Oct 2015 10:59:28 +0000 Received: from verite.pro ([195.154.189.246] helo=genius-map.net) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZrkvV-0004ee-Bb for pgsql-hackers@postgresql.org; Thu, 29 Oct 2015 10:59:28 +0000 Received: by genius-map.net (Postfix, from userid 1001) id 393BB38A0AFA; Thu, 29 Oct 2015 11:51:08 +0100 (CET) Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: psql: add \pset true/false From: "Daniel Verite" To: "Marko Tiikkaja" CC: "PostgreSQL hackers" In-Reply-To: <56308F56.8060908@joh.to> Date: Thu, 29 Oct 2015 11:51:04 +0100 Message-ID: <0949c317-3ec4-4516-a3aa-33a6cfbf5267@mm> X-Mailer: Manitou v1.4.0 X-Pg-Spam-Score: -1.9 (-) 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 Marko Tiikkaja wrote: > Since the default t/f output for booleans is not very user friendly,=20 > attached is a patch which enables you to do for example the following: Personally I think it would be worth having, but how about booleans inside ROW() or composite types ? test=3D> \pset true 1 Boolean TRUE display is "1". test=3D> \pset false 0 Boolean FALSE display is "0". test #1:=20 test=3D> select 't'::bool,'f'::bool; bool | bool=20 ------+------ 1 | 0 test #2: test=3D> select ('t'::bool,'f'::bool); row=20=20 ------- (t,f) test #3: test=3D> create type abc as (a bool, b bool, c bool); test=3D> select (true,false,true)::abc; row=09=20 --------- (t,f,t) I understand that the patch translates t/f only if the output type has the OID for bool, which is not the case in #2 or #3, but I guess users would expect #2 to output (1,0) and #3 (1,0,1). Best regards, --=20 Daniel V=E9rit=E9 PostgreSQL-powered mailer: http://www.manitou-mail.org Twitter: @DanielVerite --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers