How to generate the “create table” sql statement for an existing table in postgreSQL

pg_dump -t 'schema-name.table-name' --schema-only database-name

More info – in the manual.

Leave a Comment