In pgAdmin III you can:
If one has to do this for more than one table, is there a way to combine the scripts in one file (apart from manually copy-pasting them)? If this can be done via psql prompt or phppgadmin, that will be ok too.
Use TablePlus GUI Tool: Select the table that you want to replicate from the list in the left sidebar. Click on the Definition button on the top bar. You will notice the table creation statement to copy.
Using PostgreSQL executablewith -s (–schema-only) and -t (–table) option to generate DDL of required tables. The option -s dictates that only DDL has to be generated and the option -t dictates that we want DDL of only tables to be generated.
Here's a way using pgAdmin.
Then click "backup". The output should be a plain text file with the create table statements.
Here's the PgAdmin documentation on backup.
"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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With