How to Show a Table Schema in PostgreSQL

Last updated July 25, 2026 · By the SaturnSQL team

In psql, \d tablename shows columns, types, indexes, and constraints (\d+ adds storage details). From SQL, query information_schema.columns, which works from any client.

psql

\d orders
\d+ orders

Plain SQL (works from any client)

SELECT column_name, data_type, is_nullable, column_default
FROM information_schema.columns
WHERE table_schema = 'public'
  AND table_name = 'orders'
ORDER BY ordinal_position;

Run this in SaturnSQL

SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.

Try it free

Related PostgreSQL guides

© 2026 Panda Capital Oy Ab. All rights reserved.