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

前端 未结 4 1647
猫巷女王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条回答
  •  星月不相逢
    2020-12-22 18:14

    if version < 8.4.0

    pg_dump -D -t 
    
    
    

    Add -a before the -t if you only want the INSERTs, without the CREATE TABLE etc to set up the table in the first place.

    version >= 8.4.0

    pg_dump --column-inserts --data-only --table=

    提交回复
    热议问题