Re: Tightening binary receive functions

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Tightening binary receive functions
Дата
Msg-id 407d949e0908310427wbec329bga9e1a32d10d175cc@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Tightening binary receive functions  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: Tightening binary receive functions  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
On Mon, Aug 31, 2009 at 12:01 PM, Heikki
Linnakangas<heikki.linnakangas@enterprisedb.com> wrote:
> Hmm, perhaps we should follow what we did to chr() and ascii(): map the
> integer to unicode code points if the database encoding is UTF-8, and
> restrict the range to 0..127 for other multi-byte encodings.

I don't think we even have to worry about the database's encoding.
Just make the textual representation of "char" be \xxx (or perhaps we
could switch to \xHH now) if the value isn't a printable ascii
character. As long as "char" reads that in properly it doesn't matter
if it's not a reasonable multibyte character.

That allows people to treat it as a 1-byte integer type which happens
to allow input or output as a single ascii character which is
convenient sometimes.

-- 
greg
http://mit.edu/~gsstark/resume.pdf


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Tightening binary receive functions
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Hot Standby, conflict cache