Re: [HACKERS] BUG: NOT boolfield kills backend - Mailing list pgsql-hackers

From Sferacarta Software
Subject Re: [HACKERS] BUG: NOT boolfield kills backend
Date
Msg-id 9621.980918@bo.nettuno.it
Whole thread Raw
In response to BUG: NOT boolfield kills backend  (Zsolt Varga <redax@agria.hu>)
Responses Re: [HACKERS] BUG: NOT boolfield kills backend  (Zsolt Varga <redax@agria.hu>)
List pgsql-hackers
Hello Zsolt,

venerdì, 18 settembre 98, you wrote:


ZV> Hi,
ZV> I just found an error in every postgres versions,
ZV> (I tried 6.2.1, 6.3.2, and 6.4beta1 )

ZV> if I have a table with boolean field, and I want to negate that field,
ZV> it's kills the backend process... meanwhile 'select not ( 'T'::bool )'
ZV> works well...

ZV> create table t1 ( b bool );
ZV> insert into t1 values ( 'T' );

ZV> select not b from t1;

Wrong syntax.
The logical operator must be used in WHERE condition.
Try this:  SELECT b FROM t1 WHERE NOT b;
It works! ;)

Jose'



pgsql-hackers by date:

Previous
From: Zsolt Varga
Date:
Subject: BUG: NOT boolfield kills backend
Next
From: Sferacarta Software
Date:
Subject: Re: [SQL] PostgreSQL syntax question