How do I convert a binary pgdump (compressed) to a plain SQL file?

前端 未结 3 1351
無奈伤痛
無奈伤痛 2021-02-01 13:11

I do want to search for some data inside a database dump but these dumps are using the binary-compressed format (PGDMP header).

How can I convert these to

3条回答
  •  悲哀的现实
    2021-02-01 13:50

    pg_restore, when run without a database name, outputs a text dump to stdout; you can send that elsewhere with -f or with I/O redirection.

    pg_restore -f mydatabase.sql mydatabase.dump 
    

提交回复
热议问题