Re: Using psql to insert character codes

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Ian Barwick <barwick(at)gmx(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Using psql to insert character codes
Date: 2003-05-15 15:52:01
Message-ID: Pine.LNX.4.44.0305151616370.2756-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)net

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2003-05-15 16:21:33 Re: SQL Parser
Previous Message Josh Berkus 2003-05-15 15:42:33 Re: Calculating Percentages