[pgsql-jp: 31450] Re: テーブル名、フィールド名の日本語の利用
Yoshiaki Saita
saita @ code.iis.toyama-u.ac.jp
2003年 11月 13日 (木) 16:43:28 JST
斎田です。
> initdb --no-locale の問題かなぁとも思
> ったのですが、確認できる環境がないので黙ってました。一度お試しに
> なられてはいかがですか?
上記を元に「--no-locale」でgoogleで調べてみて
もう一度データベースを作り直してみました。
$initdb --no-locale
とすると、「"」を使わなくても
テーブル名やフィールド名に日本語が利用できるようになりました。
ありがとうございます。
--no-localeを指定しないと日本語のソートがうまくいかない
という記述はWEB上に多数あったのですが、テーブル名やフィールド名などの
問題もあるのですね。
設定変更のコマンドも書いていただいていたのですが、
ちょっと私には難しかったのでデータベースを作り直しました(^^;
>hotta @ vpn-gw ~$ grep no-locale /etc/init.d/postgresql
>su -l postgres -s /bin/sh -c "/usr/bin/initdb --pgdata=$PGDATA
> -E EUC_JP --no-locale > /dev/null 2>&1" < /dev/null
> VineLinux 2.6 + updates な環境だと文字化けが再現しませんね。
私の環境は以下のようになっております。
$rpm -qa | grep post
postgresql-7.3.4-1PGDG
postgresql-contrib-7.3.4-1PGDG
postgresql-devel-7.3.4-1PGDG
postgresql-pl-7.3.4-1PGDG
postgresql-test-7.3.4-1PGDG
postgresql-libs-7.3.4-1PGDG
postgresql-server-7.3.4-1PGDG
postgresql-debuginfo-7.3.4-1PGDG
postgresql-jdbc-7.3.4-1PGDG
postgresql-tcl-7.3.4-1PGDG
$ psql -l
List of databases
Name | Owner | Encoding
-----------+----------+-----------
mydb | postgres | EUC_JP
postgres | postgres | SQL_ASCII
template0 | postgres | SQL_ASCII
template1 | postgres | SQL_ASCII
(4 rows)
$ psql mydb
Welcome to psql 7.3.4, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
mydb=#select version();
version
----------------------------------------------------------------------------
-----------------------------
PostgreSQL 7.3.4 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2
20030222 (Red Hat Linux 3.2.2-5)
(1 row)
SQLサーバーを作るのも初めてで、ほとんど分からず
rpmパッケージをホイホイホイ、と入れていっただけなので
上手く設定できていない部分もあると思います・・・。
welcomeメッセージなども英語ですし。
ダウンロードは
http://www.postgresql.org/mirrors-ftp.html
から行いました。
------------------------------------
富山大学工学部知能情報工学科
斎田佳輝
saita @ code.iis.toyama-u.ac.jp
------------------------------------
pgsql-jp メーリングリストの案内