Re: Question about a query with two count fields - Mailing list pgsql-general

From Michael Glaesemann
Subject Re: Question about a query with two count fields
Date
Msg-id ED7CEE79-3174-428F-8708-E4B468C4728B@seespotcode.net
Whole thread Raw
In response to Re: Question about a query with two count fields  (David Fetter <david@fetter.org>)
Responses Re: Question about a query with two count fields  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Sep 11, 2007, at 13:42 , David Fetter wrote:

> 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:

What's ambigious about it? An operator cannot include a space, so !=
(no space) is *always* interpreted as one operator: not equals (<>).

space (! and = are separate operators), so ! is factorial.

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

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

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

no space, so != is one operator,

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

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

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

Michael Glaesemann
grzm seespotcode net




pgsql-general by date:

Previous
From: David Fetter
Date:
Subject: Re: Question about a query with two count fields
Next
From: Tom Lane
Date:
Subject: Re: Question about a query with two count fields