postgresql - 使用一个 INSERT 语句而不是每行 INSERT 创建 PostgreSQL 转储

标签 postgresql backup insert-into pg-dump

我尝试使用 pg_dump 进行表数据转储,如下所示:

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

而不是得到

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

我想得到

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

有没有没有任何非 PostgreSQL 后处理的方法?

最佳答案

无法使用 pg_dump 获得类似的 INSERT 语句。

关于postgresql - 使用一个 INSERT 语句而不是每行 INSERT 创建 PostgreSQL 转储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44482070/

相关文章:

postgresql - Postgres SQL - 连接来自 3 个表的数据以选择一列

windows - 撤消连接我所有文件的拙劣命令提示符副本

google-bigquery - bigquery 备份所有 View 定义

Postgresql-仅在以下情况下才合并来自多个表的数据

sql - 选择所有使用别名的地方

即使所需字段不存在,MySQL 也允许插入

sql-server-2005 - 如何在SQL中向新表添加行号?

mysql - 用另一个更新 mysql 表

postgresql - 优化 NULL/NOT NULL 标志 PostgreSQL 查询

c++ - 如何在 C++ 中备份/克隆对象