SQL script to create insert script

后端 未结 4 695
太阳男子
太阳男子 2021-02-05 15:39

A bit of a vague title, I will explain.

I am writing an SQL script to create an insert statement for each row of a table in my database, purely to be able to apply that

4条回答
  •  走了就别回头了
    2021-02-05 16:30

    pg_dump -a -U user1 -t products -f products.copy database1
    

    and then:

    psql -U user2 -d database2 -f products.copy
    

    and you're done. It's also safer and faster.

提交回复
热议问题