concatenating text and bytea

Поиск
Список
Период
Сортировка
От Vincent de Phily
Тема concatenating text and bytea
Дата
Msg-id 1366684.UTYyVzsmQ2@moltowork
обсуждение исходный текст
Ответы Re: concatenating text and bytea
Список pgsql-general

Hi,

 

I got recently bitten by this :

 

# select 'ascii'::text || E'\\xdeadbeef'::bytea, pg_typeof('ascii'::text || '\xdeadbeef'::bytea), 'ascii'::bytea || E'\\xdeadbeef'::bytea;

?column? | pg_typeof | ?column?

-----------------+-----------+----------------------

ascii\xdeadbeef | text | \x6173636969deadbeef

 

 

I would have expected a result cast as bytea or an error message telling me about incompatible types, but the result from the first column is a nasty gotcha. Is it the intented behaviour ?

 

 

--

Vincent de Phily

 

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

Предыдущее
От: ChoonSoo Park
Дата:
Сообщение: Re: Opposite function of hstore each function
Следующее
От: Tom Lane
Дата:
Сообщение: Re: concatenating text and bytea