Show type in psql SELECT

From: Mike Toews <mwtoews(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Show type in psql SELECT
Date: 2013-02-22 23:09:51
Message-ID: CAM2FmMr2XmOdU4ThhP7mR5v_UJhLPqDgAWB4c2TJpSw5P4idmw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

Type info can be viewed with "\d mytable", however often I'd like to see
the type (and typmod) info in SELECT queries with psql, similar to pgAdmin
III. For example:

my_db=# \pset type
my_db=# SELECT * FROM my_table;
gid | description | width
integer | character varying(255) | numeric(6,3)
---------+------------------------+--------------
1 | Hello | 3.220
(1 row)

or in expanded form:

my_db=# \x
my_db=# SELECT * FROM my_table;
-[ RECORD 1 ]------
gid : integer | 1
description : character varying(255) | Hello
width : numeric(6,3) | 3.220

Has anyone else thought this was a missing feature?

-Mike

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2013-02-23 01:00:02 Re: Materialized views WIP patch
Previous Message Robert Haas 2013-02-22 22:07:07 Re: sql_drop Event Trigger