Re: workaround for lack of REPLACE() function - Mailing list pgsql-general

From Tom Lane
Subject Re: workaround for lack of REPLACE() function
Date
Msg-id 16679.1026396396@sss.pgh.pa.us
Whole thread Raw
In response to workaround for lack of REPLACE() function  ("Agent155 Support" <matt@planetnet.com>)
List pgsql-general
"Agent155 Support" <matt@planetnet.com> writes:
> What do folks usually do when they have to do a global search/replace on a =
> big table?

You can code pretty much any text transformation you'd like in plperl or
pltcl, both of which languages are very strong on string manipulations.
So there's not been a lot of concern about the lack of a SQL-level
substitution operator.

IIRC, SQL99 does specify some sort of substring replacement function,
and Thomas recently implemented it for 7.3.  But it's not very bright
and I suspect people will keep falling back on plperl or pltcl to do
anything nontrivial.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: C program Killed
Next
From:
Date:
Subject: Re: XML to Postgres conversion