proper regex_replace() syntax

From: Geoffrey Myers <lists(at)serioustechnology(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: proper regex_replace() syntax
Date: 2011-06-01 17:22:40
Message-ID: 4DE67560.4020602@serioustechnology.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I want to use regex_replace() to replace characters in multiple records.

What I would like to do is this:

select regex_replace((select fname from table), 'z', 'Z'));

The problem is, the subquery returns more then one row.

So, is there a way to do what I'm trying to do? That is, replace the
same character in multiple records using regex_replace() ?

In reality, we are trying to change characters like the 1/2 character to
the three characters '1/2'.

Thanks for any assistance.

--
Until later, Geoffrey

"I predict future happiness for America if they can prevent
the government from wasting the labors of the people under
the pretense of taking care of them."
- Thomas Jefferson

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Crawford 2011-06-01 17:54:17 Re: Some clarification about TIMESTAMP
Previous Message Tom Lane 2011-06-01 15:52:41 Re: currval = currval+1