just as FYI the database i am using is Netezza so my data type is CHARACTER VARYING(6). The error i am getting is 'Buffer Overflow'. So the funny thing is when i change this '' to this ' ' then the query runs but it is putting a blank space between the values like this 88 97 but i get an error when i only make with out space like this ''. thanks -- View this message in context: http://postgresql.1045698.n5.nabble.com/using-Replace-funcion-in-postgresql-tp5771164p5771171.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general