gsandie online notebook

Your posts match “ postgres ” tag:

Show postgres CREATE TABLE commands

In MySQL you can see how a table is created using

SHOW CREATE TABLE table_name;

In postgres you don’t have this command, however you can use pg_dump to get the schema definition of a table:

$ pg_dump -U user --schema-only -t table_name database > table_schema.sql

You can also describe the structure of the table with the \d command:

database=> \d+ table_name