看板 Ruby 關於我們 聯絡資訊
※ 引述《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
kira925:postgresql.conf在哪@@ 11/09 23:00
godfat:跟整個 db 放在一起。我電腦上是 /usr/local/var/postgres/ 11/09 23:56
kira925:還是找不到orz.... 11/10 23:41
godfat:你可以看一下你怎麼啟動 pg_ctl 的,開 server需要那個路徑 11/11 02:05
ryudo:裝過好幾台redhat/ubuntu從未遇過預設是ascii過 11/24 11:59