Re: [SQL] booleans - Mailing list pgsql-sql

From Jose' Soares
Subject Re: [SQL] booleans
Date
Msg-id 36891123.EAA8C743@sferacarta.com
Whole thread Raw
In response to booleans  (Gregory Holston <holston@itd.nrl.navy.mil>)
Responses Re: [SQL] booleans
List 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'-

pgsql-sql by date:

Previous
From: Gregory Holston
Date:
Subject: booleans
Next
From: Gregory Holston
Date:
Subject: Re: [SQL] booleans