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

From: Johann Spies <johann(dot)spies(at)gmail(dot)com>
To: Francisco Olarte <folarte(at)peoplecall(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Bug in documentation (trim(...))?
Date: 2019-05-20 10:57:36
Message-ID: CAGZ55DTd2dsF-HoPciZyEPrsvbxbSakZpQbHyeTfqZUac0-9NA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks!

I was a bit stupid.

Johann

On Mon, 20 May 2019 at 12:18, Francisco Olarte <folarte(at)peoplecall(dot)com>
wrote:

> On Mon, May 20, 2019 at 12:09 PM Johann Spies <johann(dot)spies(at)gmail(dot)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.
>

--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ian Barwick 2019-05-20 11:55:24 Re: pldbgapi error
Previous Message Francisco Olarte 2019-05-20 10:18:12 Re: Bug in documentation (trim(...))?