| From: | Jochem van Dieten <jochemd(at)oli(dot)tudelft(dot)nl> | 
|---|---|
| To: | Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp> | 
| Cc: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: 0/1 vs true/false | 
| Date: | 2003-07-23 12:21:48 | 
| Message-ID: | 3F1E7DDC.2040903@oli.tudelft.nl | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
Jean-Christian Imbeault wrote:
> Just having a small argument with an application developer ...
> 
> is using 0/1 for boolean types SQL compliant? I am trying to convince 
> him that the proper SQL compliant (and postgresql compliant) syntax is 
> true/false but he won't budge ...
> 
> The app as currently written no longer works with postgres because they 
> code uses 0/1 instead of the now enforced true/false for boolean types.
> 
> Can someone point me to an SQL spec and section where this is clearly 
> stated out?
Would this be what you are looking for:
ISO/IEC 9075-2:1999 (E) ©ISO/IEC
5.3 <literal>
(..)
<boolean literal> ::=
     TRUE
     | FALSE
     | UNKNOWN
Additionally about UNKNOWN:
ISO/IEC 9075-2:1999 (E) ©ISO/IEC
4.6 Boolean types
The data type boolean comprises the distinct truth values true 
and false . Unless prohibited by a NOT NULL constraint, the 
boolean data type also supports the unknown truth value as the 
null value. This specification does not make a distinction 
between the null value of the boolean data type and the unknown 
truth value that is the result of an SQL <predicate>, <search 
condition>, or <boolean value expression>; they may be used 
interchangeably to mean exactly the same thing.
HTH,
Jochem
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Terence Ng | 2003-07-23 13:03:27 | How do I manage PDF file | 
| Previous Message | Peter Eisentraut | 2003-07-23 10:47:29 | Re: 'last updated' or 'last added' |