From: | Johann Spies <johann(dot)spies(at)gmail(dot)com> |
---|---|
To: | "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Bug in documentation (trim(...))? |
Date: | 2019-05-20 10:09:32 |
Message-ID: | CAGZ55DSQL7K3g0zBJ4-8hJDeQW4HKxGwyprcw2T3dWJaDfrZvg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
The following illustrates the problem (removing double quotes from a
string):
*js=# select regexp_replace(regexp_replace( '"University of Cape Town"',
'^"', ''),'"$', ''); regexp_replace
------------------------- University of Cape Town(1 row)js=# trim(both '"'
from '"University of Cape Town"');ERROR: syntax error at or near
"trim"LINE 1: trim(both '"' from '"University of Cape Town"');*
Example from the documentation:
*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.
Or is there another way?
Regards
Johann
--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)
From | Date | Subject | |
---|---|---|---|
Next Message | Jason Harvey | 2019-05-20 10:10:17 | pg_upgrade can result in early wraparound on databases with high transaction load |
Previous Message | Prakash Ramakrishnan | 2019-05-20 10:07:46 | pldbgapi error |