[pgsql-jp: 31044] Re: Eoncoding of PostgreSQL

Keiji Mitsubuchi keiji @ nwco.com
2003年 9月 13日 (土) 13:05:01 JST


三淵@NWC

あまり、細かい所は
よく知りませんが

デザインの発想を変えてみたら
もう少しシンプルにできるかもしれません
必要用件が、定かでないので
難しいですが
もし、PostgreSQLサーバーと、クライアントPC
が、同一ネットワークにあるか、
PVNでつながっていれば
直接、ODBC経由でACCESSと繋いだり。

データレベルでUploadしたいのであれば
Accessから、CSV(SJIS)に落として、
PHP経由で、Postgre(EUC)に流し込んだり、
CSV(SJIS)できだして、落としてきて
Execelで処理したりやっています。

SJIS=>EUC変換は、PHP内で行い
SJIS特有の丸文字等は
エスケープさせ、落としてくるときに
逆変換しています。
表示においても、逆変換を行えば
特に、問題は起きていません。

もっといい方法が有ると思いますが
可能性例としてとっていただければ
幸いです。



----- Original Message -----
From: "Toshio Uchiyama" <uchiyama @ shonan.homeunix.org>
To: <pgsql-jp @ ml.postgresql.jp>
Cc: <uchiyama @ shonan.homeunix.org>
Sent: Saturday, September 13, 2003 12:07 PM
Subject: [pgsql-jp: 31043] Eoncoding of PostgreSQL


> お世話になります.内山と申します.宜しくお願いします.
>
> 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 メーリングリストの案内