Received: from acenet.net.au (cogproxy2.cogweb.net.au [203.46.29.42]) by hub.org (8.10.1/8.10.1) with ESMTP id e5H5NXM82654 for ; Sat, 17 Jun 2000 01:23:35 -0400 (EDT) Received: from acenet.net.au [203.46.29.38] by acenet.net.au [203.46.29.42] with SMTP (MDaemon.v2.8.5.0.R) for ; Sat, 17 Jun 2000 15:19:29 +1000 Received: from [203.46.29.88] [203.46.29.88] by acenet.net.au [203.46.29.38] with SMTP (MDaemon.v2.8.5.0.R) for ; Sat, 17 Jun 2000 15:15:21 +1000 Date: Sat, 17 Jun 2000 15:15:36 +1000 (EST) From: Gordon Clarke X-Sender: gordonc@localhost.localdomain To: pgsql-sql@postgresql.org Subject: Null parm to a function Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: gordonc@acenet.net.au X-MDaemon-Deliver-To: pgsql-sql@postgresql.org X-Return-Path: gordonc@acenet.net.au X-Archive-Number: 200006/166 I want to be able to pass NULL as a parameter to a function I've defined, but I'm not allowed to do it. I believe this is a bug. The example follows: CREATE TABLE test_func( func_sun int4, surname varchar(30), value int2 NOT NULL, CONSTRAINT p01_test_func PRIMARY KEY(func_sun) ); This insert works as one would expect. INSERT INTO test_func(func_sun, surname, value) VALUES(1234,null,99); Now create the function that will insert rows into my table test_func. CREATE FUNCTION insert_row(int4,varchar,int2) RETURNS int4 AS 'INSERT INTO test_func(func_sun, surname, value) VALUES($1,$2,$3); SELECT 1 AS ignore;' LANGUAGE 'sql'; 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? Cheers...Gordon ~~~~~~~~~~~~~~ 4ZzZ Brisbane's First Community FM Station ~~~~~~~~~~~~~~ The Demo Show - Supporting Australian Unsigned Artists Mon nights 6-7pm (0800-0900UTC) on 4ZzZ 102.1 FM http://www.4zzzfm.org.au/zed (RA feed) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~