| From: | "Jose' Soares" <jose(at)sferacarta(dot)com> | 
|---|---|
| To: | Gregory Holston <holston(at)itd(dot)nrl(dot)navy(dot)mil> | 
| Cc: | pgsql-sql(at)hub(dot)org | 
| Subject: | Re: [SQL] booleans | 
| Date: | 1998-12-29 17:28:03 | 
| Message-ID: | 36891123.EAA8C743@sferacarta.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| 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'-
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Gregory Holston | 1998-12-29 17:36:32 | Re: [SQL] booleans | 
| Previous Message | Gregory Holston | 1998-12-29 15:39:49 | booleans |