Thread: BUG #15566: can't insert money type
The following bug has been logged on the website: Bug reference: 15566 Logged by: Yusuke Sonomura Email address: yusuke.sonomura@jp.fujitsu.com PostgreSQL version: 10.3 Operating system: Solaris Description: -Issue I can't INSERT numeric data to money column on Solaris. And I can't understand what error message says. I think codeset should be "UTF-8". --How to reproduce export LANG=ja_JP.UTF-8 initdb --encoding="UTF-8" --locale="ja_JP.UTF-8" --lc-collate="C" --lc-ctype="C" --lc-messages="ja_JP.UTF-8" --lc-monetary="ja_JP.UTF-8" --lc-numeric="ja_JP.UTF-8" --lc-time="ja_JP.UTF-8" -D inst1 pg_ctl start -D inst1 psql -d postgres<<EOF CREATE TABLE test (a money); INSERT INTO test values (2); EOF --Output I got CREATE TABLE 2018-12-21 22:15:41.389 JST [8295] WARNING: could not determine encoding for locale "ja_JP.UTF-8": codeset is "646" WARNING: could not determine encoding for locale "ja_JP.UTF-8": codeset is "646" 2018-12-21 22:15:41.390 JST [8295] ERROR: default conversion function for encoding "" to "UTF8" does not exist 2018-12-21 22:15:41.390 JST [8295] STATEMENT: INSERT INTO test values (2); ERROR: default conversion function for encoding "" to "UTF8" does not exist --Output I expected Just success of insertion. --Installation I used I got postgresql-10.3-S11.sparc-64.tar.bz2 from https://www.postgresql.org/ftp/binary/v10.3/solaris/solaris11/sparc/ --Version 10.3 --Platform information Solaris 11 SunOS s023g023 5.11 11.3 sun4v sparc sun4v --my environment Memory size: 4096 Megabytes CPU 1649MHz*2 --my output of locale -a C POSIX de_DE.UTF-8 en_US.UTF-8 es_ES.UTF-8 fr_FR.UTF-8 it_IT.UTF-8 ja_JP.UTF-8 ja_JP.eucJP ko_KR.UTF-8 pt_BR.UTF-8 zh_CN.UTF-8 zh_TW.UTF-8
=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes: > -Issue > I can't INSERT numeric data to money column on Solaris. > And I can't understand what error message says. I think codeset should be > "UTF-8". > --How to reproduce > export LANG=ja_JP.UTF-8 > initdb --encoding="UTF-8" --locale="ja_JP.UTF-8" --lc-collate="C" > --lc-ctype="C" --lc-messages="ja_JP.UTF-8" --lc-monetary="ja_JP.UTF-8" > --lc-numeric="ja_JP.UTF-8" --lc-time="ja_JP.UTF-8" -D inst1 Hm. I think you're shooting yourself in the foot by specifying --lc-ctype="C"; in the locale world, that setting is what determines the character encoding. If you want to use UTF8 then LC_CTYPE had better match that. This combination of LC_xxx settings does seem to work more or less sanely on glibc, but it doesn't surprise me that it doesn't work on Solaris. > --Output I got > 2018-12-21 22:15:41.389 JST [8295] WARNING: could not determine encoding > for locale "ja_JP.UTF-8": codeset is "646" > WARNING: could not determine encoding for locale "ja_JP.UTF-8": codeset is > "646" I suppose "646" here refers to ISO 646, which is basically ASCII. Maybe we should recognize codeset "646" as a synonym for PG_SQL_ASCII. But I have a feeling that that'd just leave you with some other, even less decipherable failure later, given this combination of LC_xxx settings. regards, tom lane