Re: Using upper() / decode() together - Mailing list pgsql-novice

From Sean Davis
Subject Re: Using upper() / decode() together
Date
Msg-id 00a701c51d9e$ef6fffa0$1f6df345@WATSON
Whole thread Raw
In response to Using upper() / decode() together  ("Ross Gohlke" <ross@grinz.com>)
Responses Re: Using upper() / decode() together
List pgsql-novice
----- 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



pgsql-novice by date:

Previous
From: MaXX
Date:
Subject: Re: pgadmin3 column edit question
Next
From: "Sean Davis"
Date:
Subject: Re: Import csv file into multiple tables in Postgres