Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create PostgreSQL dump with ONE INSERT statement instead of INSERT per row

I try to do a table data dump using pg_dump, something like this:

pg96\bin\pg_dump ... --format plain --section data --column-inserts --file obj.account.backup --table obj.account database_xyz

Instead of getting

INSERT INTO obj.account(name, email, password) VALUES ('user1','email1','password1');
INSERT INTO obj.account(name, email, password) VALUES ('user2','email2','password2');

I would like to get

INSERT INTO obj.account (name, email, password) VALUES 
('user1','email1','password1'),
('user2','email2','password2');                                                  

Is there a way for this without any Non-PostgreSQL postprocessing?

like image 389
Rainer Avatar asked Jun 11 '17 08:06

Rainer


1 Answers

There is no way to get INSERT statements like that with pg_dump.

like image 183
Laurenz Albe Avatar answered Sep 30 '22 12:09

Laurenz Albe