Re: [rfc] unicode escapes for extended strings

From: Marko Kreen <markokr(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org, Sam Mason <sam(at)samason(dot)me(dot)uk>
Subject: Re: [rfc] unicode escapes for extended strings
Date: 2009-04-17 21:55:33
Message-ID: e51f66da0904171455j11edf3bj46eef6da2279a3a7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 4/18/09, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
> > Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> >> ISTM that one of the uses of this is to say "store the character
> >> that corresponds to this Unicode code point in whatever the database
> >> encoding is"
>
> > I would think you're right. As long as the given character is in the
> > user's character set, we should allow it. Presumably we've already
> > confirmed that they have an encoding scheme which allows them to store
> > everything in their character set.
>
>
> This is a good way to get your patch rejected altogether. The lexer
> is *not* allowed to invoke any database operations (such as
> pg_conversion lookups) so it cannot perform arbitrary encoding
> conversions.

Ok. I was just thinking that if such conversion can be provided easily,
it should be done. But if not, then no need to make things complex.

Seems the proper way to look at it is that unicode escapes have
straightforward meaning only in UTF8 encoding. So it should be
fine to limit them in other encodings to ascii.

> If this sort of facility is what you want, the previously suggested
> approach via a decode-like runtime function is a better fit.

I'm a UTF8-only kind on guy, so people who actually have experience
of using other encodings must comment on that one.

--
marko

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2009-04-17 22:19:52 Re: [rfc] unicode escapes for extended strings
Previous Message Tom Lane 2009-04-17 21:33:59 Re: [rfc] unicode escapes for extended strings