Search Postgresql Archives

Re: Question about a query with two count fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 11, 2007 at 02:28:24PM -0400, Tom Lane wrote:
> "George Pavlov" <gpavlov@xxxxxxxxxxxxxx> writes:
> >> From: David Fetter [mailto:david@xxxxxxxxxx]
> >> This case statement returns true when z factorial is zero, so I'd
> >> recommend the SQL standard <> or IS NOT DISTINCT FROM instead.
> 
> > i do hate potential ambiguity... the != was something stuck in my brain
> > from old sybase, i think. i always liked != ("not equals") as more
> > intuitive than <> ("less than, greater than"???), but i will have to
> > change my ways, especially if "the standard" says so.
> 
> The notion that != might be scanned as two operators whereas <> would
> not be is nonsense.  I assume David was just joking.

My mistake.

I believe that foo!=bar without white space should simply error out
because there is no reasonable, unambiguous way to parse it.  Here's
what we get right now:

test=# SELECT (2! =0);
 ?column? 
----------
 f
(1 row)

test=# SELECT (2!=0);
 ?column? 
----------
 t
(1 row)

test=# SELECT (2 !=0);
 ?column? 
----------
 t
(1 row)

test=# SELECT (2 ! =0);
 ?column? 
----------
 f
(1 row)

test=# SELECT (2 != 0);
 ?column? 
----------
 t
(1 row)

test=# SELECT (2 ! = 0);
 ?column? 
----------
 f
(1 row)

-- 
David Fetter <david@xxxxxxxxxx> http://fetter.org/
phone: +1 415 235 3778        AIM: dfetter666
                              Skype: davidfetter

Remember to vote!
Consider donating to PostgreSQL: http://www.postgresql.org/about/donate

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux