Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 2CF009FA305 for ; Wed, 15 Aug 2007 16:05:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 50163-01 for ; Wed, 15 Aug 2007 16:05:43 -0300 (ADT) X-Greylist: delayed 00:19:33.932899 by SQLgrey-1.7.5 Received: from corp.etelos.com (corp.etelos.com [216.251.101.81]) by postgresql.org (Postfix) with ESMTP id 00C089F94F0 for ; Wed, 15 Aug 2007 16:05:46 -0300 (ADT) Received: from [192.168.1.149] (c-67-168-3-229.hsd1.wa.comcast.net [67.168.3.229]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by corp.etelos.com (Postfix) with ESMTP id A74C63868E for ; Wed, 15 Aug 2007 11:46:04 -0700 (PDT) Message-ID: <46C349EA.5050201@etelos.com> Date: Wed, 15 Aug 2007 11:46:02 -0700 From: Jon Collette User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Boolean without default declared Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200708/129 X-Sequence-Number: 29067 If a column with a boolean datatype doesn't have a default value. What type of value is set if nothing is inserted into that column? Here is my test table and the queries I have tried. I can't seem to be able to select the rows where happy has no value. Table "public.users" Column | Type | Modifiers --------+-----------------------+----------- id | character varying(32) | email | text | happy | boolean | money | numeric | *select * from users; * id | email | happy | money ----+--------+-------+--------- 4 | me | | 1324.23 4 | me | | 1324.23 3 | as | | 123.2 1 | afjssd | t | *select * from users where happy;* id | email | happy | money ----+--------+-------+------- 1 | afjssd | t | *select * from users where not happy;* id | email | happy | money ----+-------+-------+------- (0 rows) *select * from users where happy = NULL;* id | email | happy | money ----+-------+-------+------- (0 rows) *select * from users where happy = '';* ERROR: invalid input syntax for type boolean: ""