From: Jose' Soares <jose@sferacarta.com>
To: Gregory Holston <holston@itd.nrl.navy.mil>
Cc: pgsql-sql@hub.org
Subject: Re: [SQL] booleans
Date: Tue, 29 Dec 1998 18:28:03 +0100
Message-ID: <36891123.EAA8C743@sferacarta.com> (raw)
References: <Pine.SUN.3.91.981229103532.6410B-100000@shell>
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'-
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: jose@sferacarta.com, holston@itd.nrl.navy.mil, pgsql-sql@hub.org
Subject: Re: [SQL] booleans
In-Reply-To: <36891123.EAA8C743@sferacarta.com>
References: <Pine.SUN.3.91.981229103532.6410B-100000@shell> <36891123.EAA8C743@sferacarta.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox