You can use the alternative syntax with a string literal instead of the array constructor, which is a Postgres function and may cause trouble when you need to pass values - like in a prepared statement:
SELECT myschema.myfunc('0d6311cc-0d74-4a32-8cf9-87835651e1ee'
, '{"(0d6311cc-0d74-4a32-8cf9-87835651e1ee,25)"
,"(6449fb3b-844e-440e-8973-31eb6bbefc81,10)"}'::mytype[]);
I added a line break between the two row types in the array for display here. That's legal.
How to find the correct syntax for any literal?
Here is a demo:
CREATE TEMP TABLE mytype (id uuid, amount numeric(13,4));
INSERT INTO mytype VALUES
('0d6311cc-0d74-4a32-8cf9-87835651e1ee', 25)
,('6449fb3b-844e-440e-8973-31eb6bbefc81', 10);
SELECT ARRAY(SELECT m FROM mytype m);
Returns:
{"(0d6311cc-0d74-4a32-8cf9-87835651e1ee,25.0000)","(6449fb3b-844e-440e-8973-31eb6bbefc81,10.0000)"}
It probably should be noted that any table (including temporary tables) implicitly creates a row type of the same name.
postgresql
since that one draws a lot more attention than version-specific tags. – Erwin Brandstetter Jul 24 '13 at 16:46