Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e5H5kWM30045 for ; Sat, 17 Jun 2000 01:46:32 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id BAA18047; Sat, 17 Jun 2000 01:46:01 -0400 (EDT) To: gordonc@acenet.net.au cc: pgsql-sql@postgresql.org Subject: Re: Null parm to a function In-reply-to: References: Comments: In-reply-to Gordon Clarke message dated "Sat, 17 Jun 2000 15:15:36 +1000" Date: Sat, 17 Jun 2000 01:46:01 -0400 Message-ID: <18044.961220761@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200006/167 Gordon Clarke writes: > Now if I try to do the same thing but via my function, > SELECT insert_row(1235,null,100); > I get the following error > ERROR: typeidTypeRelid: Invalid type - oid = 0 > Why wont the function allow me to pass a 'null' parm? You're running into a longstanding shortcoming of the function-call interface inside Postgres: there's only one NULL-parameter flag passed to a function, so if any of the parameters are NULL then they all are taken to be NULL. I'm not quite sure why you're seeing that particular error message, but in any case you'd have gotten a failure from the NOT NULL constraints on the other two columns. The only comfort I have to offer is that this will work in 7.1 --- in fact, your example does work in current development sources. That's a result of a major rewrite of the function manager. There's no chance of backpatching the fix into 7.0.* or earlier. regards, tom lane