Re: Using psql to insert character codes - Mailing list pgsql-sql

From Peter Eisentraut
Subject Re: Using psql to insert character codes
Date
Msg-id Pine.LNX.4.44.0305151616370.2756-100000@peter.localdomain
Whole thread Raw
In response to Re: Using psql to insert character codes  (Ian Barwick <barwick@gmx.net>)
List pgsql-sql
Ian Barwick writes:

> That seems to imply though that this statement in the docs:
> "...where xxx is an octal number, is the character with the corresponding
> ASCII code."
> is not completely correct. Maybe it should read something like:
>
> "...where xxx is an octal number which corresponds to a valid character in the
> database encoding."

What it actually does is insert exactly one byte of the given value. The
problem is that you can easily construct invalid code sequences that way,
and I that should not be allowable.

What I would like better is if \xxx took xxx as a code point and converted
it to the appropriately encoded byte sequence.  For single-byte encodings
that would mean no change, for Unicode it would make a lot more sense than
what it does now, but I don't know if that concept can be applied to all
character set encodings.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-sql by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Calculating Percentages
Next
From: Fabio Rollo
Date:
Subject: SQL Parser