Re: Question about a query with two count fields

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: David Fetter <david(at)fetter(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, George Pavlov <gpavlov(at)mynewplace(dot)com>, delux256-postgresql(at)yahoo(dot)com, PostgreSQL GENERAL List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Question about a query with two count fields
Date: 2007-09-11 19:18:29
Message-ID: ED7CEE79-3174-428F-8708-E4B468C4728B@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-09-11 19:26:48 Re: Question about a query with two count fields
Previous Message David Fetter 2007-09-11 18:42:13 Re: Question about a query with two count fields