Show type in psql SELECT - Mailing list pgsql-hackers

From Mike Toews
Subject Show type in psql SELECT
Date
Msg-id CAM2FmMr2XmOdU4ThhP7mR5v_UJhLPqDgAWB4c2TJpSw5P4idmw@mail.gmail.com
Whole thread Raw
Responses Re: Show type in psql SELECT
Re: Show type in psql SELECT
Re: Show type in psql SELECT
List 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

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: sql_drop Event Trigger
Next
From: Josh Berkus
Date:
Subject: Re: Materialized views WIP patch