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

1 Answer

+1 vote
by (349k points)
selected by
 
Best answer

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

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

...