Re: BUG #3453: Error on COPY TO/FROM 'non-ascii-path' - Mailing list pgsql-bugs

From ITAGAKI Takahiro
Subject Re: BUG #3453: Error on COPY TO/FROM 'non-ascii-path'
Date
Msg-id 20070717152938.6761.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Whole thread Raw
In response to Re: BUG #3453: Error on COPY TO/FROM 'non-ascii-path'  ("Hiroshi Saito" <z-saito@guitar.ocn.ne.jp>)
Responses Re: BUG #3453: Error on COPY TO/FROM 'non-ascii-path'  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
"Hiroshi Saito" <z-saito@guitar.ocn.ne.jp> wrote:

Hi Saito-san,

> I think that it is use restrictions now....This is not a BUG.

Sure, but I'd like to notice that we don't pay attention about
mismatch of PG and OS encodings.

> In Japan, use is restricted by the reason referred to as that server
> encoding does not support all now. Then, It is Shift-jis encoding...

We don't have to support SJIS as a server encoding for this purpose.
We just need to have converter function like convert_server_to_os()
and use it when the path might include non-ascii characters.
We can skip the function in usual file operations, for example, opening
a relation file, because paths under $PGDATA consists of only ascii
characters. We can minimize the performance impact from the conversion.

One problem is that we might not have enough information about OS
encodings, at least we cannot determine it using a portable method.
If we would know the native encoding, convertion itself will be easy.
For example, we can use convert('path-for-copy', server-encoding, 'SJIS')
in Japanese version of Windows.

> > Bug reference:      3453
> > Description:        Error on COPY TO/FROM 'non-ascii-path'
> > When I set postgres a different character encoding from OS, COPY TO/FROM
> > 'non-ascii-path' cannot open the path.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

pgsql-bugs by date:

Previous
From: "Hiroshi Saito"
Date:
Subject: Re: BUG #3453: Error on COPY TO/FROM 'non-ascii-path'
Next
From: "Chris Bowlby"
Date:
Subject: BUG #3450: Multiple Stored procedure calls cause issue with temp tables...