Newbie question about casting literals - oracle/postgres

From: "Naeem Bari" <naeem(dot)bari(at)agilissystems(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Newbie question about casting literals - oracle/postgres
Date: 2004-10-27 01:24:56
Message-ID: 53F35087CC531844AD19CCAE6FA669293690@util.agilissystems.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ok,

I have a query that runs fine in oracle:

select driver_id, 'GREEN' as color, pos_date, pos_lat, pos_lon
from driver_pos
where driver_id = 1
order by pos_date

The only way this works in postgres is by casting 'GREEN' to text using
'GREEN'::text

The problem is then this does not work with oracle. Since my software
has to support both databases, I am left in a bit of a bind. Any ideas
on how to make postgres accept 'GREEN' as text without my having to
spell it out by casting?

Thanks!
naeem

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2004-10-27 02:27:31 Re: [Fwd: Abrupt close of pgsql backend]
Previous Message Scott Marlowe 2004-10-27 01:24:14 Re: list fieldnames in table? (from PHP)