From: s <smarie(at)ekno(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject:
Date: 2002-06-26 22:43:28
Message-ID: 1025131408.3d1a43902df3a@www.ekno.lonelyplanet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I love the simplicity of this approach. Unfortunately it gives the
same error message. I guess I'll just have to IFDEF my source code.

Thanks,

Sarah
msarahm(at)ekno(dot)com

Andrew Sullivan wrote:

On Wed, Jun 26, 2002 at 05:50:44PM +0000, s wrote:
> I am trying to keep my select statements compatible for
running on
> oracle or postgres. I ran into a problem with a query that is
part of
> a union. The original query clause is of the form:
>
> select distinct f.id, '' from foo f;
>
> I need the empty string as the second attribute because the
first part

Oracle does, IIRC, some strange things with empty strings, handling
'' as NULL, no? I think this is an Oracle gotcha, if I'm right,
because '' is not NULL, in fact. (Consider the difference between
knowing that I do not have a middle name, and not knowing what my
middle name is.)

So I wonder if this will work:

select disinct f.id, ' ' from foo f;

The ' ' should get automatically cast to TEXT, and you should be all
right.

A

--
----
Andrew Sullivan 87 Mowat Avenue
Liberty RMS Toronto, Ontario Canada
<andrew(at)libertyrms(dot)info> M6K 3E3
+1 416 646 3304 x110

____________________________________________________________________________
Lonely Planet's ekno - more than a phonecard
Get ekno before you go!
http://www.ekno.lonelyplanet.com

Responses

  • Re: at 2002-06-27 14:08:09 from Jeff Eckermann

Browse pgsql-general by date

  From Date Subject
Next Message Ben 2002-06-26 22:48:36 Re: Advocacy Idea.
Previous Message Varun Kacholia 2002-06-26 22:09:19 Re: Advocacy Idea.