Piotr Synowiec
Piotr Synowiec
~1 min read

Categories

Tags

How to check table definition in PostgreSQL DB

SELECT *
FROM information_schema.columns
WHERE table_schema = 'YOUR_SCHEMA' AND table_name = 'YOUR_TABLE'
ORDER BY ordinal_position;

where:

  • YOUR_SCHEMA represents schema where table is defined
  • YOUR_TABLE represents table name