Skip site navigation (1) Skip section navigation (2)

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 (view raw, whole thread or download thread mbox)
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

work for you?


In response to


pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group