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
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.