Re: [SQL] 2 questions. - Mailing list pgsql-hackers

From Chris Johnson
Subject Re: [SQL] 2 questions.
Date
Msg-id Pine.LNX.4.00.9809230837320.27650-100000@boreus.bedfo.ma.tiac.net
Whole thread Raw
List pgsql-hackers
ALERT - cc'd to pgsql-hackers since this looks like a bug in the parser to
me.

On Tue, 22 Sep 1998, Colin Dick wrote:

> Can you do a multiple comparison on the same field.  I would like to be
> able to find entries that have either a null entry or a blank entry as a
> boolean result and sort by the boolean result.

In a word Yes - it looks like the parser simply doesn't understand your
SQL and craps out on it.

> (ie: select field='' or field is null as x from table order by x;)

I write this as:

select field as x from table where field='' or field is null order by x;

which works properly (even tested it on 6.3.2).  Either you aren't
supposed to write queries as you did or the parser should figure out what
you are trying to do.  Either way I think it's a bug.  You can resolve it
yourself by just writing the query as I did.

Chris


pgsql-hackers by date:

Previous
From: Keith Parks
Date:
Subject: pg_dump, problem with user defined types?
Next
From: Sferacarta Software
Date:
Subject: Re: [SQL] 2 questions.