psql: add \pset true/false

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: PostgreSQL hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: psql: add \pset true/false
Date: 2015-10-28 09:03:18
Message-ID: 56308F56.8060908@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello hello,

Since the default t/f output for booleans is not very user friendly,
attached is a patch which enables you to do for example the following:

=# \pset true TRUE
Boolean TRUE display is "TRUE".
=# \pset false FALSE
Boolean FALSE display is "FALSE".
=# select true, false;
bool | bool
------+-------
TRUE | FALSE
(1 row)

(For anyone reviewing: I didn't touch the parts of describe.c which do
this for nullPrint:

myopt.nullPrint = NULL;

since I thought it was dubious in the first place, and I don't think we
output booleans in the describe commands.)

.m

Attachment Content-Type Size
psqltruefalse_v1.patch text/x-patch 6.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-10-28 10:55:45 Add EXTRA_CFLAGS to configure
Previous Message Victor Wagner 2015-10-28 08:18:39 Re: Patch: Implement failover on libpq connect level.