Re: have you feel anything when you read this ?

Поиск
Список
Период
Сортировка
От Eugene E.
Тема Re: have you feel anything when you read this ?
Дата
Msg-id 441EA3AA.3080909@bankir.ru
обсуждение исходный текст
Ответ на Re: have you feel anything when you read this ?  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: have you feel anything when you read this ?  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-sql
Alvaro Herrera wrote:
> Eugene E. wrote:
> 
>>Alvaro Herrera wrote:
> 
> 
>>>text is not bytea.
>>
>>source says:
>>
>>typedef text varlena;
>>typedef bytea varlena;
> 
> 
> This means that as far as the C type system is concerned, both bytea and
> text are treated as "struct varlena".  It doesn't mean that they are
> processed by the same input/output functions, which they aren't.
> 
> NUL bytes are preserved in bytea, and used as terminators in text.  I
> don't find this surprising at all, do you?

I do found surprising it.
since both (text and bytea) I/O functions has CSTRING arguments and 
resut type. - this only means a user should perform some unescaping on 
the bytea value he got. THE SAME THING he should do with a string value 
if he decide to use type text and to escape NUL-bytes before input.
then what a difference bitween those types except strlen() ?


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

Предыдущее
От: "Eugene E."
Дата:
Сообщение: Re: have you feel anything when you read this ?
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: have you feel anything when you read this ?