Skip site navigation (1) Skip section navigation (2)

regex_replace problem

From: Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk>
To: pgsql-sql(at)postgresql(dot)org
Subject: regex_replace problem
Date: 2008-01-25 16:15:58
Message-ID: 200801251615.59186.gary.stainburn@ringways.co.uk (view raw or flat)
Thread:
Lists: pgsql-sql
Hi folks.

I've got a problem with regex_replace.  As you can see below psql displays the 
error saying the function does not exist.  Can anyone see why, and what I 
need todo to fix it.

Cheers

goole=# select distinct ud_rfl from used_diary where ud_rfl ~ ' *= *';
  ud_rfl
-----------
 12 = 1wk
 12=1WK
 12m = 1wk
 6=1WK
(4 rows)

goole=# select distinct regex_replace(ud_rfl,' *= *','+') from used_diary 
where ud_rfl ~ ' *= *';
ERROR:  function regex_replace(character varying, "unknown", "unknown") does 
not exist
HINT:  No function matches the given name and argument types. You may need to 
add explicit type casts.
goole=# select distinct replace(ud_rfl,'=','+') from used_diary where ud_rfl 
~ ' *= *';
  replace
-----------
 12 + 1wk
 12+1WK
 12m + 1wk
 6+1WK
(4 rows)
[root(at)stan ~]# rpm -qa|grep postgresql
postgresql-jdbc-8.1.9-1.fc5
postgresql-libs-8.1.9-1.fc5
postgresql-pl-8.1.9-1.fc5
postgresql-contrib-8.1.9-1.fc5
postgresql-server-8.1.9-1.fc5
postgresql-docs-8.1.9-1.fc5
postgresql-python-8.1.9-1.fc5
postgresql-8.1.9-1.fc5
postgresql-test-8.1.9-1.fc5
postgresql-tcl-8.1.9-1.fc5
[root(at)stan ~]#    
-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000     

Responses

pgsql-sql by date

Next:From: Scott MarloweDate: 2008-01-25 16:19:09
Subject: Re: [SQL] Unclosed connections
Previous:From: acec acecDate: 2008-01-25 16:11:53
Subject: This SQL works under Mysql, not Postgresql.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group