Re: Using upper() / decode() together

From: "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov>
To: <ross(at)grinz(dot)com>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Using upper() / decode() together
Date: 2005-02-28 14:08:10
Message-ID: 00a701c51d9e$ef6fffa0$1f6df345@WATSON
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


----- Original Message -----
From: "Ross Gohlke" <ross(at)grinz(dot)com>
To: <pgsql-novice(at)postgresql(dot)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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Ross Gohlke 2005-03-01 03:54:08 Re: Using upper() / decode() together
Previous Message Sean Davis 2005-02-28 11:31:23 Re: Import csv file into multiple tables in Postgres