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 46B0ED7E0E for ; Mon, 29 Aug 2005 17:10:54 -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 80807-07 for ; Mon, 29 Aug 2005 20:10:52 +0000 (GMT) Received: from window.monsterlabs.com (window.monsterlabs.com [216.183.105.176]) by svr1.postgresql.org (Postfix) with SMTP id 25EB8D7E12 for ; Mon, 29 Aug 2005 17:10:51 -0300 (ADT) Received: (qmail 8317 invoked from network); 29 Aug 2005 20:10:52 -0000 Received: from pcp0012204803pcs.blairblvd.tn.nash.comcast.net (HELO ?192.168.15.110?) (69.245.49.69) by 0 with SMTP; 29 Aug 2005 20:10:52 -0000 In-Reply-To: <20050824050501.43778.qmail@web35204.mail.mud.yahoo.com> References: <20050824050501.43778.qmail@web35204.mail.mud.yahoo.com> Mime-Version: 1.0 (Apple Message framework v734) Content-Type: text/plain; charset=WINDOWS-1252; delsp=yes; format=flowed Message-Id: Cc: pgsql-sql@postgresql.org Content-Transfer-Encoding: quoted-printable From: "Thomas F. O'Connell" Subject: Re: question Date: Mon, 29 Aug 2005 15:10:48 -0500 To: Matt A. X-Mailer: Apple Mail (2.734) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.019 required=5 tests=[AWL=0.019] X-Spam-Level: X-Archive-Number: 200508/271 X-Sequence-Number: 22499 Matt, In PostgreSQL 8.0.3, I see: postgres=3D# select nullif( '1', '' ); nullif -------- 1 (1 row) postgres=3D# select nullif( '', '' ) is null; ?column? ---------- t (1 row) What behavior are you expecting? -- Thomas F. O'Connell Co-Founder, Information Architect Sitening, LLC Strategic Open Source: Open Your i=99 http://www.sitening.com/ 110 30th Avenue North, Suite 6 Nashville, TN 37203-6320 615-469-5150 615-469-5151 (fax) On Aug 24, 2005, at 12:05 AM, Matt A. wrote: > 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 > > ---------------------------(end of =20 > broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster >