+2 votes
in Databases by (14.2k points)
What command/query should I use to see the list of columns and their datatypes of a table in PostgreSQL?

1 Answer

0 votes
by (22.2k points)

Go to the psql commande line and type the following command:

\d+ table_name

If you want to use SQL, type the following query:

select column_name,data_type
from information_schema.columns
where table_name = 'YOUR_TABLE_NAME';