Re: How to trim Bytea fields

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: How to trim Bytea fields
Дата
Msg-id 43833809.1070905@joeconway.com
обсуждение исходный текст
Ответ на How to trim Bytea fields  (Howard Cole <howardnews@selestial.com>)
Ответы Re: How to trim Bytea fields  (Howard Cole <howardnews@selestial.com>)
Список pgsql-general
Howard Cole wrote:
> Hi,
>
> I have an bytea field that contains data with a lot of trailing blank
> space composed of multiple '\000' zero bytes. Does anyone know of a
> quick SQL fix to trim these bytes from the data?

trim() will remove '\000' bytes from both ends -- would that work for you?

select trim('\\000'::bytea from '\\00012\\00034\\000\\000'::bytea);
   btrim
----------
  12\00034
(1 row)

Joe

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: problem with GRANT postgres 8.0.4
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: problem with GRANT postgres 8.0.4