Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id CC8CC635165 for ; Wed, 1 Apr 2009 16:02:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 96856-03-4 for ; Wed, 1 Apr 2009 16:01:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 4B3DC634A3A for ; Wed, 1 Apr 2009 16:01:31 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n31J19jO010035; Wed, 1 Apr 2009 15:01:09 -0400 (EDT) To: "Deirdre Hall" cc: pgsql-sql@postgresql.org Subject: Re: Stored function not accepting null value? In-reply-to: <03f401c9b2f6$a3c2ee90$5062140a@dc06012008> References: <03f401c9b2f6$a3c2ee90$5062140a@dc06012008> Comments: In-reply-to "Deirdre Hall" message dated "Wed, 01 Apr 2009 13:17:30 -0500" Date: Wed, 01 Apr 2009 15:01:09 -0400 Message-ID: <10034.1238612469@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.062 tagged_above=0 required=5 tests=AWL=0.062 X-Spam-Level: X-Archive-Number: 200904/5 X-Sequence-Number: 32351 "Deirdre Hall" writes: > I am using a stored function to determine whether a table needs an update > or insert, based on the merge_db function in the postgres documentation. > (Not currently including it below because it's rather long, but other than > the fact that it contains 27 values, it's pretty much the same as that > example.) Well, not including it is a good way to ensure that no one will really know what the problem is ... but I wonder whether you declared the function STRICT. That'd prevent it from being called with a NULL argument, which seems to fit the reported behavior. regards, tom lane