+2 votes
in Databases by (11.1k 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 (15.7k 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';

Related questions

+3 votes
1 answer
+2 votes
1 answer
...