转储 postgresql 数据库源一的编码为 'C.UTF-8',目标一的编码为 'en_US.UTF-8'

Dump postgresql databases source one has encoding 'C.UTF-8' and destination one has encoding 'en_US.UTF-8'

尝试将源数据库的编码 "C.UTF-8" 转储到目标数据库的编码 "en_US.UTF-8",如下命令:

pg_dump -C --no-acl --no-owner -h HOST_SOURCE -U Admin -p 5432 SOURCE_DB | psql -h HOST_DESTINATION -U Admin -p 5432 DESTINATION_DB

我收到以下错误:

ERROR:  invalid locale name: "C.UTF-8"
\connect: FATAL:  database "SOURCE_DB" does not exist

如何忽略 pg_dump 命令的编码?

取决于@LaurenzAlbe 的评论,当我删除 -C 选项时,该命令工作正常!

pg_dump --no-acl --no-owner -h HOST_SOURCE -U Admin -p 5432 SOURCE_DB | psql -h HOST_DESTINATION -U Admin -p 5432 DESTINATION_DB