作者godfat (godfat 真常)
看板Ruby
标题Re: [心得] RoR + Postgresql template修正
时间Wed Nov 9 18:56:28 2011
※ 引述《kira925 (蓝色飞舞之剑)》之铭言:
: 2. new encoding (UTF8) is incompatible with the encoding of the
: template database (SQL_ASCII)
: RoR预设是用 UTF8 作为编码,但是 Postgresql 的预设居然是... SQL_ASCII
啊,这麽一说我忽然想起来了。我记得 postgres 在透过 initdb 产生 database
时,预设的 encoding 是根据你的 locale 决定的。我自己的 locale 是
en_US.UTF-8, 所以我跑 initdb 产生出来的 database 预设就是 UTF-8.
但有些 linux 预设 locale 是 C, 即 ASCII-7bit, 那跑 initdb 的预设 encoding
就会变成 ASCII...
预设 encoding 设定可以在 postgresql.conf 调整。
--
Hear me exalted spirits. Hear me, be you gods or devils, ye who hold
dominion here:
I am a wizard without a home. I am a wonderer seeking refuge.
Sacrifice
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.135.38.235
1F:推 kira925:postgresql.conf在哪@@ 11/09 23:00
2F:→ godfat:跟整个 db 放在一起。我电脑上是 /usr/local/var/postgres/ 11/09 23:56
3F:推 kira925:还是找不到orz.... 11/10 23:41
4F:→ godfat:你可以看一下你怎麽启动 pg_ctl 的,开 server需要那个路径 11/11 02:05
5F:→ ryudo:装过好几台redhat/ubuntu从未遇过预设是ascii过 11/24 11:59