Re: Bug in documentation (trim(...))?

Поиск
Список
Период
Сортировка
От Francisco Olarte
Тема Re: Bug in documentation (trim(...))?
Дата
Msg-id CA+bJJbxrcfDPaBA6v7SYFjthLBKcDk0FTA68cPJ=UoLUkDiQYw@mail.gmail.com
обсуждение исходный текст
Ответ на Bug in documentation (trim(...))?  (Johann Spies <johann.spies@gmail.com>)
Ответы Re: Bug in documentation (trim(...))?  (Johann Spies <johann.spies@gmail.com>)
Список pgsql-general
On Mon, May 20, 2019 at 12:09 PM Johann Spies <johann.spies@gmail.com> wrote:
> The following illustrates the problem (removing double quotes from a string):

Missing "select " in your examples, is it intentional?

> js=# trim(both '"' from '"University of Cape Town"');
> ERROR:  syntax error at or near "trim"
> LINE 1: trim(both '"' from '"University of Cape Town"');
> js=# trim(both 'xyz' from 'yxTomxx');
> ERROR:  syntax error at or near "trim"
> LINE 1: trim(both 'xyz' from 'yxTomxx');
>         ^
> I would think that "trim" if it works in this case would be a cheaper function than using rexexp_replace twice.

( copied from your mail AFTER "select " ):

$ select trim(both '"' from '"University of Cape Town"');
          btrim
-------------------------
 University of Cape Town
(1 row)

$ select trim(both 'xyz' from 'yxTomxx');
 btrim
-------
 Tom
(1 row)

Francisco Olarte.



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

Предыдущее
От: Jason Harvey
Дата:
Сообщение: pg_upgrade can result in early wraparound on databases with hightransaction load
Следующее
От: Johann Spies
Дата:
Сообщение: Re: Bug in documentation (trim(...))?