BUG #5854: base64 decode returns bytea and no text

Поиск
Список
Период
Сортировка
От Chris R.
Тема BUG #5854: base64 decode returns bytea and no text
Дата
Msg-id 201101281445.p0SEjjdN078867@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #5854: base64 decode returns bytea and no text  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #5854: base64 decode returns bytea and no text  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      5854
Logged by:          Chris R.
Email address:      chricki@gmx.net
PostgreSQL version: 9.02
Operating system:   CentOS 5.5
Description:        base64 decode returns bytea and no text
Details:

There is a break in how pg9.0 handles decoding base64 encoded data.

With PostgreSQL 8.4:

select decode(encode('abc', 'base64'), 'base64');
  decode
----------
 \x616263


With PostgreSQL 9.0:

select decode(encode('abc', 'base64'), 'base64');
  decode
----------
 \x616263


To get the old result, convert_from helps out:
select convert_from(decode(encode('abc', 'base64'), 'base64'), 'UTF8');

Still, shouldn't this be consistent with 8.x and 9.x?

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: A bug to report
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #5854: base64 decode returns bytea and no text