Aka*_*mar 6 postgresql money restore postgresql-9.3 pg-restore
导入时出现此错误:
Run Code Online (Sandbox Code Playgroud)pg_restore: [archiver (db)] COPY failed for table "transaction_details": ERROR: invalid input syntax for type money: "$0.00"
restore完成,但transaction_details桌子是空的。这是 Heroku 的 PostgreSQL Dump 数据库。
Heroku 上的 PostgreSQL 版本是 9.3.15,在我的系统上也是如此
我使用的命令:
pg_restore: [archiver (db)] COPY failed for table "transaction_details":
ERROR: invalid input syntax for type money: "$0.00"
Run Code Online (Sandbox Code Playgroud)
有人可以提出解决方案吗?
Erw*_*ter 11
由于此数据类型的输出对区域设置敏感,因此可能无法将
money数据加载到具有不同设置的数据库中lc_monetary。为避免出现问题,在将转储还原到新数据库之前,请确保lc_monetary其值与转储的数据库中的值相同或等效。
去检查:
SHOW lc_monetary;
Run Code Online (Sandbox Code Playgroud)
错误消息 ( '$0.00') 中的示例值适用于默认设置(以及其他):
lc_monetary = 'C';
Run Code Online (Sandbox Code Playgroud)
您可以将其设置为postgresql.conf,重新加载并重试...
这种奇特的行为是该money类型不受欢迎的原因之一。