Re: Bytea/Base64 encoders for libpq - interested?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bytea/Base64 encoders for libpq - interested?
Дата
Msg-id 26723.999619271@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Bytea/Base64 encoders for libpq - interested?  ("Joe Conway" <joseph.conway@home.com>)
Ответы Re: Bytea/Base64 encoders for libpq - interested?
Re: Bytea/Base64 encoders for libpq - interested?
Список pgsql-hackers
"Joe Conway" <joseph.conway@home.com> writes:
> You're right, as usual (I was tired when I wrote this last night ;). But I
> think we have to escape/unescape both null and '\', don't we?

Yeah, you're right.  My turn to have not thought hard enough.

> I agree that it would be better to *not* allow implicit coercions. Given
> that, any preferences on function names? Are text_to_bytea() and
> bytea_to_text() too ugly?

They're pretty ugly, but more importantly they're only suitable if we
have exactly one conversion function each way.  If we have two, what
will we call the second one?

I think it's okay to let the argument type be implicit in the function
argument list.  Something like text_escaped(bytea) and text_direct(bytea)
(with inverses bytea_escaped(text) and bytea_direct(text)) might do.
I'm not totally happy with "direct" to suggest minimum escaping, though.
Better ideas anyone?
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [PATCHES] to_char and Roman Numeral (RN) bug
Следующее
От: Rene Pijlman
Дата:
Сообщение: Re: [JDBC] Troubles using German Umlauts with JDBC