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 6FE66D7290 for ; Wed, 24 Aug 2005 02:05:08 -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 17329-08 for ; Wed, 24 Aug 2005 05:05:05 +0000 (GMT) Received: from web35204.mail.mud.yahoo.com (web35204.mail.mud.yahoo.com [66.163.179.83]) by svr1.postgresql.org (Postfix) with SMTP id 6A89ED727C for ; Wed, 24 Aug 2005 02:05:04 -0300 (ADT) Received: (qmail 43780 invoked by uid 60001); 24 Aug 2005 05:05:01 -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=G8+jYmQHT2Hafng8wniTtTiqbKO/fUcWEJOxXXanCnMYA0L2QWtLeRdNbP0wjv9IC4JuIMAQvfBjBqvjPfi88cIR3lLtmizgXUx6SFeAnoQG5E37mWKJ+yrrj/PYTs6CIcgLNgrCbfEDK0QLtUkPHeINihUonpMFVUDeGeY+sIA= ; Message-ID: <20050824050501.43778.qmail@web35204.mail.mud.yahoo.com> Received: from [70.104.144.58] by web35204.mail.mud.yahoo.com via HTTP; Tue, 23 Aug 2005 22:05:01 PDT Date: Tue, 23 Aug 2005 22:05:01 -0700 (PDT) From: "Matt A." Subject: question 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/254 X-Sequence-Number: 22482 I have a rating section on a website. It has radio buttons with values 1-5 according to the rating level. Lastly there is a null option for n/a. We use null for n/a so it's excluded from the AVG() calculations. We used nullif('$value','') on inserts in mssql. We moved to postgres and love it but the nullif() doesn't match empty strings to each other to return null other than a text type, causing an error. This is a major part of our application. AKA nullif('1','') would insert 1 as integer even though wrapped in ''. Also nullif('','') would evaluate NULL and insert the "not a value" accordingly. Is there a workaround for this so it doesn't break our rating system? We cannot always enter a value for a integer column. Is there any other way to accomplish this? Please help. __________________________________ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail