----- Original Message -----
From: "Ross Gohlke" <ross@grinz.com>
To: <pgsql-novice@postgresql.org>
Sent: Thursday, February 24, 2005 8:03 PM
Subject: [NOVICE] Using upper() / decode() together
> I'm using postgres as the backend of a custom PHP Web application. Text
> is base64_encode-d in php, then stored in varchar fields in postgres.
>
> I'm trying to do this:
> SELECT * from table where upper(decode(field,'base64')) like
> upper('%sometext%');
>
> I keep getting this error:
> ERROR: function upper(bytea) does not exist
> HINT: No function matches the given name and argument types. You may
> need to add explicit type casts.
Does doing something like (untested):
SELECT * from table where upper(decode(field,'base64')::varchar) like
upper('%sometext%');
work for you?
Sean