Thread: strange behaviour in plpgsql:null arguments
Hi, I think I found something that is strange. I can't detect whether i passed a NULL to stored procedure in plpgsql when it happens that I use composites I warn that I haven't read the sql standards though. Here is the code: CREATE TYPE ttype AS ( t1 int, t2 int ); CREATE OR REPLACE FUNCTION ttypetest(t ttype) RETURNS ttype AS $$ BEGIN IF t IS NULL THEN RAISE EXCEPTION 'NULL input'; END IF; RETURN t; END $$ LANGUAGE plpgsql; SELECT ttypetest(NULL); I also find it quite difficult to unset an element from array in postgres. Regards, Peter Filipov
On Mon, Nov 28, 2005 at 03:39:37PM +0200, Peter Filipov wrote: > I can't detect whether i passed a NULL to stored procedure > in plpgsql when it happens that I use composites This came up a few months ago; see Tom Lane's response to the following message: http://archives.postgresql.org/pgsql-sql/2005-09/msg00137.php > I also find it quite difficult to unset an element from array in postgres. Consider starting a new thread with a subject relevant to that particular problem. An example showing what you mean by "unset an element" might make the problem easier to answer. -- Michael Fuhr