Re: [SQL] booleans

Jose Soares <jose@sferacarta.com>

From: "Jose' Soares" <jose@sferacarta.com>
To: Gregory Holston <holston@itd.nrl.navy.mil>
Cc: pgsql-sql@hub.org
Date: 1998-12-29T17:28:03Z
Lists: pgsql-sql
Gregory Holston wrote:
> 
> Good day all,
> 
> I just wrote an HTML form with a PHP script to enter data into a table
> witha boolean field.  When I pressed enter it returned the following error
> "Warning: PostgresSQL query failed: ERROR: Bad boolean external
> representation".  The script is as follows:
> 
> if( $id ) {
>         pg_Exec($conn, "INSERT into authors
>         VALUES ('$pubrelease', '$id', '$first');");
>         }
> 
> I would appreciate any help.
> 

   Postgres supports bool as the SQL3 boolean type. bool can have one of
   only two states: 'true' or 'false'.
     
Boolean accepts only one of the following values:

   True:  't', TRUE, 't', 'true', 'y', 'yes', '1'
   False: 'f', FALSE, 'f', 'false', 'n', 'no', '0'

- Note that you have to enclose data between '' except for words
TRUE/FALSE.
  Probably you are trying to insert data in a different way.

-Jose'-