I need to know the column type in PostgreSQL (i.e. varchar(20)). I know that I could probably find this using \d something in psql, but I need it to be done with a select query.
Is this possible in PostgreSQL?
I need to know the column type in PostgreSQL (i.e. varchar(20) ). I know
Share
You can fully describe a table using postgres with the following query:
Tith this you will retrieve column names and data type.
It is also possible to start psql client using the
-EoptionAnd then a simple
\d mytablewill output the queries used by postgres to describe the table. It work for every psql describe commands.