postgresql - Postgres 用大写字母转储特定表

标签 postgresql shell

我正在尝试使用 -t 执行特定表的 postgres 转储。但是,该表中有一个大写字母,我收到“未找到匹配的表”。我尝试在表名周围使用引号和双引号,但它们不起作用。我怎样才能让 pg 识别大写字母?谢谢!

pg_dump -h hostname dbname -t tableName > pgdump.sql 

最佳答案

这是在普通模式下转储表的完整命令:

pg_dump --host localhost --port 5432 --username "postgres" --role "postgres"  --format plain  --file "complete_path_file" --table "schema_name.\"table_name\"" "database_name"

或者你可以这样做:

pg_dump -t '"tablename"' database_name > data_base.sql

在这里查看最后一页:Documentation

关于postgresql - Postgres 用大写字母转储特定表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13905162/

相关文章:

python - psycopg2 实际上没有插入数据

postgresql - 如何在本地打开 .sql 文件?

ruby-on-rails - 带有 json 列参数的范围

java - OSX 如何让 Shell 脚本将目录更改为脚本所在的目录?

linux - 在 shell 脚本中运行 SQL 查询,然后将输出发送到电子邮件

linux - shell 脚本到 ls 并在 ls 结果上执行命令

postgresql - GeoJSON FeatureCollections 是否可以用于使用 ST_GeomFromGeoJSON 创建 PostGIS 几何图形?

linux - 需要读取文件并将结果用作 shell 脚本中的命名变量

linux - UNIX Shell 和历史特征

SQL:通过 Postgres 语句翻译递归连接时出现问题