Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2D7E0635675 for ; Wed, 1 Apr 2009 16:21:27 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 44332-01-7 for ; Wed, 1 Apr 2009 16:21:25 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sch-smb2.sch.delcan.com (schaumburg.delcan.net [198.235.16.19]) by mail.postgresql.org (Postfix) with ESMTP id 07606635E81 for ; Wed, 1 Apr 2009 16:21:11 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by sch-smb2.sch.delcan.com (Postfix) with ESMTP id 36E0ABA6C02C; Wed, 1 Apr 2009 14:20:55 -0500 (CDT) Received: from sch-smb2.sch.delcan.com ([127.0.0.1]) by localhost (sch-smb2.sch.delcan.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aoyfKk-Zuojc; Wed, 1 Apr 2009 14:20:55 -0500 (CDT) Received: by sch-smb2.sch.delcan.com (Postfix, from userid 101) id 250EDBA6C02D; Wed, 1 Apr 2009 14:20:55 -0500 (CDT) Received: from sch-smb2.sch.delcan.com (SCH-SMB2.sch.delcan.com [10.20.98.23]) by sch-smb2.sch.delcan.com (Postfix) with ESMTP id 1F239BA6C029; Wed, 1 Apr 2009 14:20:55 -0500 (CDT) From: "Deirdre Hall" To: "'Tom Lane'" Cc: References: <03f401c9b2f6$a3c2ee90$5062140a@dc06012008> <10034.1238612469@sss.pgh.pa.us> Subject: Re: Stored function not accepting null value? Date: Wed, 1 Apr 2009 14:20:55 -0500 (CDT) Message-ID: <042101c9b2ff$7fb59120$5062140a@dc06012008> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-Mailer: Zimbra 5.0.11_GA_2696.RHEL4 (ZimbraConnectorForOutlook/5.0.2817.11) In-Reply-To: <10034.1238612469@sss.pgh.pa.us> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 thread-index: Acmy/ESl7aKJ3GgvS8GML2WdsC3PngAAyjNQ X-Originating-IP: [65.196.233.130] X-Copyrighted-Material: Please visit http://www.delcan.com/privacy.htm X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/6 X-Sequence-Number: 32352 And that would be where I went wrong. Thanks. DHall -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Sent: Wednesday, April 01, 2009 2:01 PM To: Deirdre Hall Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] Stored function not accepting null value? "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 ____ This communication may contain information that is confidential, privileged or subject to copyright. If you are not the intended recipient, please advise by return e-mail and delete the message and any attachments immediately without reading, copying or forwarding to others.