You can use two statement for data dump. These statements are pg_dump and pg_dumpall. pg_dump can has table data, but pg_dumpall can has all database objects these are users, groups, stores and other object, so pg_dumpall has all database object. You can move database from product system to test system with pg_dumpall easyly.
Example
For take dump
postgres$ > pg_dump databasename > dumpname.dump.out Note:You can take backup only one database.
postgres$ > pg_dumpall > dumpname.dump.out Note:You can take all database object with this statement.For restore from dump
postgres$ > psql -f dumpname.dump.out