On Wednesday 11 May 2011 22:29:40 Tony Capobianco wrote: > We are converting from Oracle to Postgres. An Oracle script contains > this line: > > select replace(firstname,'"'), memberid, emailaddress from members; > > in an effort to replace the " with nothing. How can I achieve the same > result with Postgres? > > Here's the Postgres error I get: > > select replace(firstname,'"'), memberid, emailaddress from members; > ERROR: function replace(character varying, unknown) does not exist > LINE 1: select replace(firstname,'"'), memberid, emailaddress from m...
From the fine documentation <http://www.postgresql.org/docs/current/static/functions-string.html> replace(string text, from text, to text) Example: replace('abcdefabcdef', 'cd', 'XX') IOW, this function takes three parameters, the first one being the actual text you want to make a replace on. Yor ecample above shoul probably be written as: SELECT REPLACE((SELECT firstname FROM members), '%', ''), memberid, emailaddress FROM members; although it's a little above me why you would want to select firstname in the first place when you proceed to replace it with nothing. regards, Leif -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql