Re: bytea escaping

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема Re: bytea escaping
Дата
Msg-id 3B8CBE2E.7355F3A6@tm.ee
обсуждение исходный текст
Ответ на Upcoming events  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> 
> "Joe Conway" <joseph.conway@home.com> writes:
> > ... is there a good reason that byteaout
> > octal escapes all non-printable characters?
> 
> Well, AFAICS it *has to* escape nulls (zero bytes).  Whether it escapes
> more stuff is a matter of taste once you accept that.

output function seems to escape all bytes <=\027 and >=\177

> What we really need to have to make bytea more useful is direct read and
> write functions that don't require any escaping (a la large object
> lo_read/lo_write).

Two intertwined things we are currently missing:

1) a portable BINARY protocol (i _think_ that's what the typreceive and
typsend 
fields in pg_type are meant to implement - currently they are allways
the same as
typinput, typoutput)

hannu=# select count(*) from pg_type where typreceive != typinput or
typsend != typoutput;count 
-------    0
(1 row)

2) a FE-BE protocol that allows first PREPARING a statement and then
EXECUTEing 
it with args. Most DB's have it, SPI has it and both ODBC and JDBC have
it. 
This should use the above-mentioned protocol to send the arguments to
execute.

having LO access to things is also nice, but it is independent of being
able to 
easily store binary data in a database, especially if we claim PG to be
an ORDBMS.

-------------
Hannu


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

Предыдущее
От: Thomas Swan
Дата:
Сообщение: Re: bugs - lets call an exterminator!
Следующее
От: Karel Zak
Дата:
Сообщение: compile error: c_lock assembler