... - Mailing list pgsql-general

From s
Subject ...
Date
Msg-id 1025131408.3d1a43902df3a@www.ekno.lonelyplanet.com
Whole thread Raw
Responses Re:  (Jeff Eckermann <jeff_eckermann@yahoo.com>)
List 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@ekno.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@libertyrms.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



pgsql-general by date:

Previous
From: Ben
Date:
Subject: Re: Advocacy Idea.
Next
From: Martijn van Oosterhout
Date:
Subject: Re: unlimited undo/journaling