Search code examples
postgresqldumpdatabase-restoredatabase-dump

PostgreSQL dump/restore


I don't want to Dump the entire table but only certain records in a table in my dump file and later restore the same.
P.S.: I want to do the same for more than 1 table in my database but dump it in a single file.
Is this possible? If yes then how do i go about it?

Thank in advance.


Solution

  • As @Pondlife mentioned in his answer had to use COPY command but did not solve my Problem of getting all the dump data into a single file.
    So from the idea given by Craig Ringer made individual files for each table and got all the files compressed into a single archive file.
    For restore uncompressed the archive to generate individual files later used them to restore the Tables.

    Had to answer my own question so it might help somebody.