Re: Stripping empty space from all fields in a table?

Поиск
Список
Период
Сортировка
От Bricklen Anderson
Тема Re: Stripping empty space from all fields in a table?
Дата
Msg-id 4542809B.9090702@presinet.com
обсуждение исходный текст
Ответ на Stripping empty space from all fields in a table?  ("J B" <jbwellsiv@gmail.com>)
Список pgsql-general
J B wrote:
> Guys,
>
> I have a table that has various fields that have whitespace in the
> values. I'd like to roll through and strip the left and right whitespace
> out of all fields that contain strings.
>
> Is there any easy way to do this?
>
> Thanks!
>
> JB

"trim" will strip the whitespace from both sides. ltrim and rtrim are
front/back specific.

select '-'||trim('  asdf  ')||'-';
  ?column?
----------
  -asdf-

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Mailing list problem?
Следующее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: Mailing list problem?