Fork Me On GitLab

psql Tips

Psql Tip #131

The \gdesc metacommand will show the decsription (column names and datatypes) of the current query buffer. The wuery is not actually executed.
laetitia=# select * from test;
 id | value 
----+-------
  1 | bla
  2 | bla
  3 | bla
  4 | bla
  5 | bla
  6 | bla
(6 rows)

laetitia=# \gdesc
 Column |  Type   
--------+---------
 id     | integer
 value  | text
(2 rows)
This feature is available since Postgres 11.
See Postgres documentation for more information.
Try a new tipSee them all