X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6BD5052DC4 for ; Sat, 20 Aug 2005 22:40:25 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18918-01 for ; Sun, 21 Aug 2005 01:40:22 +0000 (GMT) Received: from web35209.mail.mud.yahoo.com (web35209.mail.mud.yahoo.com [66.163.179.88]) by svr1.postgresql.org (Postfix) with SMTP id 269CD5293E for ; Sat, 20 Aug 2005 22:40:20 -0300 (ADT) Received: (qmail 92298 invoked by uid 60001); 21 Aug 2005 01:40:23 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Dyn5zV1HOV2F7saeP2uuIzlpb1TEShuQl6Fo/HjhpDFmibkoZ4KdWbPeMeuCijrtM/VZXGkOYYbNnRKZ4qmgro4k/yBlFnGcEDvET4VOi0YbFBiaZtytbI8o4NjJPUN4c8gNRvdBpP7Ntm1eHZK8E4b68QKPXPoZz+rpYC6XLVw= ; Message-ID: <20050821014023.92296.qmail@web35209.mail.mud.yahoo.com> Received: from [70.104.144.58] by web35209.mail.mud.yahoo.com via HTTP; Sat, 20 Aug 2005 18:40:23 PDT Date: Sat, 20 Aug 2005 18:40:23 -0700 (PDT) From: "Matt L." Subject: nullif('','') on insert To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.374 required=5 tests=[DNS_FROM_RFC_ABUSE=0.374] X-Spam-Level: X-Archive-Number: 200508/255 X-Sequence-Number: 22483 I need to test whether or not a value is null on insert. Example: insert into table (column) values nullif('','')); ERROR: column "column" is of type boolean but expression is of type text. It works in MSSQL (probably against not standards) but nonetheless I need to make it work. I assume it's returning 'NULL' w/ quotes? I don't know where to look to alter it. I looked into functions but all I see is how to write "AS queries" or point to various snippets. I'd rather just alter the nullif function. Is there a function for this or could someone give me an example to insert NULL? Cheers Matt __________________________________ Yahoo! Mail for Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail