Our production DB is very big. I would like to export just a few thousands of record from it preferably with pg:pull...
Is there a way to accomplish that? Any idea is appreciated.
Sadly, but there's no way to limit rows with pg:pull
. However there's another way to make a backup of DB. Here's a link to Heroku Import/Export Guide. You can use pgbackups
tool to create a backup. After that, you can simply download it from Heroku.
Another way could be using pg_dump
tool (PostgreSQL tool for creating DB dumps), but, as far as I know, it has no way of limiting number of records. However you can dump a table structure without records with pg_dump
, and then fill it by yourself or by using custom script. Also, you can try and save a limited number of records to file using SQL COPY.