Received: from bologna.nettuno.it (bologna.nettuno.it [193.43.2.1]) by hub.org (8.9.1/8.9.1) with ESMTP id MAA04078 for ; Tue, 29 Dec 1998 12:31:18 -0500 (EST) (envelope-from jose@sferacarta.com) Received: from proxy.sferacarta.com (mail@sfcabop1.nettuno.it [193.207.10.213]) by bologna.nettuno.it (8.8.6/8.8.6/NETTuno 3.1) with ESMTP id SAA04901; Tue, 29 Dec 1998 18:30:59 +0100 (MET) Received: from rosso.sferacarta.com (sferacarta.com) [10.20.30.5] by proxy.sferacarta.com with esmtp (Exim 2.05 #1 (Debian)) id 0zv4hq-0001F4-00; Tue, 29 Dec 1998 19:21:26 +0000 Message-ID: <36891123.EAA8C743@sferacarta.com> Date: Tue, 29 Dec 1998 18:28:03 +0100 From: "Jose' Soares" Reply-To: sferac@bo.nettuno.it Organization: Sfera Carta Software X-Mailer: Mozilla 4.05 [en] (Win95; I) MIME-Version: 1.0 To: Gregory Holston CC: pgsql-sql@hub.org Subject: Re: [SQL] booleans References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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'-