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 219C8D7BE4 for ; Tue, 30 Aug 2005 11:59:10 -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 78524-06 for ; Tue, 30 Aug 2005 14:59:01 +0000 (GMT) Received: from yertle.kcilink.com (yertle.kcilink.com [65.205.34.180]) by svr1.postgresql.org (Postfix) with ESMTP id 79F14D84F8 for ; Tue, 30 Aug 2005 11:58:58 -0300 (ADT) Received: from [192.168.7.103] (host-103.int.kcilink.com [192.168.7.103]) by yertle.kcilink.com (Postfix) with ESMTP id 66F7AB80F for ; Tue, 30 Aug 2005 10:59:03 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v734) In-Reply-To: <20050824050501.43778.qmail@web35204.mail.mud.yahoo.com> References: <20050824050501.43778.qmail@web35204.mail.mud.yahoo.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <9158F005-5B73-405A-8CD6-97D6B4621F62@khera.org> Content-Transfer-Encoding: 7bit From: Vivek Khera Subject: Re: question Date: Tue, 30 Aug 2005 10:59:01 -0400 To: pgsql-sql@postgresql.org X-Mailer: Apple Mail (2.734) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.018 required=5 tests=[AWL=0.018] X-Spam-Level: X-Archive-Number: 200508/284 X-Sequence-Number: 22512 On Aug 24, 2005, at 1:05 AM, Matt A. wrote: > 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. I *certainly* hope you're not passing $value in straight from your web form directly into the SQL. You're opening yourself up for SQL injection attacks. Why not just have your app that reads the form generate the proper value to insert? That is the safe route. Vivek Khera, Ph.D. +1-301-869-4449 x806