Search Postgresql Archives

Array as parameter for plpgsql function

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

 



How does one pass an array as a parameter to a plpgsql function? I have tried this the following. I can't seem to get a select statement to work without syntax problems and no examples in Postgres book to help with this :( This is just a test so please ignore the fact it is a simple function.

CREATE FUNCTION create_record_test(text[][]) RETURNS int4 AS '

	DECLARE
	
	test_array ALIAS FOR $1;      -- alias for input array	
		
	BEGIN
	
		return array_upper(test_array,1)
		
	END;	
' LANGUAGE 'plpgsql';

SELECT create_record_test(ARRAY[ARRAY['A','test one'],ARRAY['B','test two']]) AS output;

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[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