I'm trying to insert into another database table that I exported using pg_dump:
pg_dump -U postgres --column-inserts --data-only -t table3 -t table2 -t table 1 > c:/file database
The problem is that the tables exist in the other db and I'm getting many primary key errors.
Any other ways to update the tables? how can I add delete table before insertion in the command line?
Thanks in advance!
You could manually do a truncate on the table prior to importing it. I don't think there are any command line options to include a delete of the table. The other alternative might be to drop the database prior to importing the data. You'd naturally have to include the schema then.