How to generate a CREATE script for several tables in pgAdmin III?
"pg_dump" is also an option here. The -s
flag for schema-only and -t
to select specific tables. It's not psql
or pgAdmin
though. It's a utility available to the PostgreSQL user.
Example:
sudo su - postgres
pg_dump -s database
Here's a way using pgAdmin.
- Right-click on your database (or schema).
- Choose "backup"
- Under "Format" choose "plain"
- Under "Dump Options #1" choose "Only schema"
- Under "Objects" choose the tables you want.
Then click "backup". The output should be a plain text file with the create table statements.
Here's the PgAdmin documentation on backup.