Re: workaround for lack of REPLACE() function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Agent155 Support" <matt(at)planetnet(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: workaround for lack of REPLACE() function
Date: 2002-07-11 14:06:36
Message-ID: 16679.1026396396@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches

"Agent155 Support" <matt(at)planetnet(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message George.T.Essig 2002-07-11 14:23:39 Re: XML to Postgres conversion
Previous Message Tom Lane 2002-07-11 13:36:58 Re: C program Killed

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-07-11 14:11:25 Re: effective_cache_size
Previous Message Karel Zak 2002-07-11 13:41:38 Re: Proposal: CREATE CONVERSION

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-07-11 16:20:45 Re: implementing query timeout
Previous Message Jan Wieck 2002-07-11 04:57:23 Re: implementing query timeout