pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
regex_replace problem
2+ messages / 2 participants
[nested] [flat]

* regex_replace problem
@ 2008-01-25 16:15 Gary Stainburn <gary.stainburn@ringways.co.uk>
  2008-01-25 17:43 ` Re: regex_replace problem Frank Bax <fbax@sympatico.ca>
  0 siblings, 1 reply; 2+ messages in thread

From: Gary Stainburn @ 2008-01-25 16:15 UTC (permalink / raw)
  To: 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@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@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     



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: regex_replace problem
  2008-01-25 16:15 regex_replace problem Gary Stainburn <gary.stainburn@ringways.co.uk>
@ 2008-01-25 17:43 ` Frank Bax <fbax@sympatico.ca>
  0 siblings, 0 replies; 2+ messages in thread

From: Frank Bax @ 2008-01-25 17:43 UTC (permalink / raw)
  To: pgsql-sql

Gary Stainburn wrote:
> Hi folks.
> 
> I've got a problem with regex_replace.


The function is regexp_replace - you misspelled it.



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2008-01-25 17:43 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-01-25 16:15 regex_replace problem Gary Stainburn <gary.stainburn@ringways.co.uk>
2008-01-25 17:43 ` Frank Bax <fbax@sympatico.ca>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox