[pgsql-jp: 31043] Eoncoding of PostgreSQL

Toshio Uchiyama uchiyama @ shonan.homeunix.org
2003年 9月 13日 (土) 12:07:01 JST


お世話になります.内山と申します.宜しくお願いします.

	Microsoft Access で貰ったデータをPostgreSQL
の埋め込みがたC言語を使ってデータ処理しようと考えています.
しかし,S-JIS を nkf を使ってEUC-JP に変換すると
若干文字化けしますので,UNICODE を使ってやってみたらと
と考えているところです.そこで質問なのですが,

1. PostgreSQL の initdb --encode=unicode とすると
initdb はできるのですが,

postgres @ shonan> initdb --encoding=unicode
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale ja_JP.eucJP.
This locale setting will prevent the use of indexes for pattern matching
operations.  If that is a concern, rerun initdb with the collation order
set to "C".  For more information see the Administrator's Guide.

Fixing permissions on existing directory /usr/local/pgsql/data... ok
creating directory /usr/local/pgsql/data/base... ok
creating directory /usr/local/pgsql/data/global... ok
creating directory /usr/local/pgsql/data/pg_xlog... ok
creating directory /usr/local/pgsql/data/pg_clog... ok
creating template1 database in /usr/local/pgsql/data/base/1... ok
creating configuration files... ok
initializing pg_shadow... ok
enabling unlimited row size for system tables... ok
initializing pg_depend... ok
creating system views... ok
loading pg_description... ok
creating conversions... ok
setting privileges on built-in objects... ok
vacuuming database template1... ok
copying template1 to template0... ok

Success. You can now start the database server using:

    /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
or
    /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start

postgres @ shonan>

となり,localeは,jp_JP.eucJP.になります.これは
大丈夫でしょうか? encoding と locale の違いが良く
分からないです.

2. excel では,unicode (txt) で保存するオプションが
あるのですが,Access では,見当たりません.Access
のデータを unicode で保存できるのでしょうか?

3. 1,2 がクリアできたとして,Access のデータを unicode(txt)
で,FreeBSD 4.8R + PostgreSQL に ftp して,PostgreSQL に
インポートできるでしょうか?

4. もし,1, 2,3 がクリアできたとして,PostgreSQL のunicode
で処理したデータを,ftp でwindows 2000 pro なマシンのAccess
に,インポートできるでしょうか?

以上,お知恵を拝借できれば幸いです.

---------
内山敏郎
uchiyama @ shonan.homeunix.org toshio @ siene.homeunix.net
http://shonan.homeunix.org/ http://shonan.homeunix.org:8001/
http://shonan.homeunix.org:8002/



pgsql-jp メーリングリストの案内