Search Postgresql Archives

strange behaviour in plpgsql:null arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux