PostgreSQL – Export Heroku Postgres database, but exclude table

I want to export the Postgres database of my Heroku application, but I want to exclude a table. Is this possible?

This is the command I used to export the entire Postgres database:

$PGUSER=my_username PGPASSWORD=my_password heroku pg:pull DATABASE_URL my- application-name`

Maybe there is a way to exclude a table, or specify a list of tables to include?

In ordinary pg dump commands, you can use the -t option to specify the tables to be included, And use the -T option to exclude the table.

You can try this:

$ PGPASSWORD=mypassword pg_dump -Fc --no-acl --no-owner -T *table you want to exclude* -h localhost -U myuser mydb> mydb.dump

I want to export my Heroku application Postgres database, but I want to exclude a table. Is this possible?

This is the command I used to export the entire Postgres database:

$PGUSER=my_username PGPASSWORD=my_password heroku pg:pull DATABASE_URL my- application-name`

Maybe there is a way to exclude a table, or specify a list of tables to include?

In ordinary pg dump commands, you can use the -t option to specify the tables to be included, and use the -T option to exclude the tables.

< /p>

You can try this:

$ PGPASSWORD=mypassword pg_dump -Fc --no-acl --no-owner -T *table you want to exclude* -h localhost -U myuser mydb> mydb.dump

Leave a Comment

Your email address will not be published.