Postgresql – How to export a subset of tabledata from a prodution database into the local testing database

herokupostgresql

We have a relatively big production postgres based db: ~20GB.
The PostgreSQL database is hosted on heroku.

I would like to copy a small subset of the table data to my local database so I can run some tests on them without having to work on production.

I do not want to generate sample data myself, but rather use the data which already exists in the production environment.

~100 rows from each table in the database would be sufficient.
Is there an easy way to accomplish this?

Best Answer

I haven't used this tool, but Jailer promises to do just that

Database Subsetting and Browsing Tool. Exports consistent, referentially intact row-sets from relational databases (JDBC)

http://sourceforge.net/projects/jailer/