How can I download the Schema from a PostgreSQL db hosted on heroku?
backup, database-schema, heroku, postgresql
Solution
Use pg_dump instead. The `--schema-only|-s` option does just what you're looking for.
pg_dump --schema-only -h host -U user -f schema_dump_file dbname
Then just manually grab a bit of data that you want. There's no easy way, that I know of or seen, around that.
Problem
I would like to create a ERM-Diagram from a PostgreSQL Database which is hosted on heroku. The database itself is almost 20 GB big, which makes downloading the whole dump not an option. Is there a way to simply backup and download the schema including foreign keys, and maybe 10 rows of each table in the database, which could subsequently be restored into a local dabase via the `psql`-command? I have the PG Backups Plus addon enabled, but that seems to only enable me to dump the whole database with the complete dataset.