0

I am using pgAdmin to load the backup into memory, but it is very slow due to the size of the backup. Also I have to use PostgreSQL server to restore data.

I have lots of ~10GB compressed backups and they require to restore ~7h each, then I use an sql query to export all data from one table as a CSV.

How can I export the data from the dump file as a csv?

cuga
  • 123
  • 1
  • 8
  • 1
    You can't use SQL Server to restore a Postgres backup. –  Dec 19 '18 at 12:36
  • @a_horse_with_no_name I have to. I use PostgreSQL Portable. If you mean that SQL server is not PostgreSQL, then my apologize – cuga Dec 19 '18 at 12:39
  • The term "SQL Server" is usually associated with the database product from Microsoft. –  Dec 19 '18 at 12:44
  • If you just want to dump a table to csv do `copy my_table to '/var/tmp/myfile.csv' csv header` – Hambone Dec 19 '18 at 12:46
  • @Hambone the problem is that the table is in the .backup file – cuga Dec 19 '18 at 12:47
  • 1
    Is the backup file in the Postgres "custom" format, or in (compressed) SQL? This makes a big difference to what options you can use with [pg_restore](https://www.postgresql.org/docs/current/app-pgrestore.html). – IMSoP Dec 19 '18 at 15:39

0 Answers0