Using pg_dump to only get insert statements from one table within database

前端 未结 4 1641
猫巷女王i
猫巷女王i 2020-12-22 17:19

I\'m looking for a way to get all rows as INSERT statements from one specific table within a database using pg_dump in PostgreSQL.

E.g., I

4条回答
  •  -上瘾入骨i
    2020-12-22 18:19

    If you want to DUMP your inserts into an .sql file:

    1. cd to the location which you want to .sql file to be located
    2. pg_dump --column-inserts --data-only --table= > my_dump.sql

      Note the > my_dump.sql command. This will put everything into a sql file named my_dump

      提交回复
      热议问题