相关疑难解决方法(0)

将PostgreSQL表中的特定行导出为INSERT SQL脚本

我有一个名为的数据库模式:nyummy和一个名为的表cimory:

create table nyummy.cimory (
  id numeric(10,0) not null,
  name character varying(60) not null,
  city character varying(50) not null,
  CONSTRAINT cimory_pkey PRIMARY KEY (id)
);
Run Code Online (Sandbox Code Playgroud)

我想将cimory表的数据导出为插入SQL脚本文件.但是,我只想导出城市等于'东京'的记录/数据(假设城市数据都是小写的).

怎么做?

解决方案是否在免费的GUI工具或命令行中无关紧要(尽管GUI工具解决方案更好).我曾尝试过pgAdmin III,但我找不到这样做的选择.

postgresql export insert sql-scripts postgresql-copy

171
推荐指数
7
解决办法
16万
查看次数