Sfortunatamente, PostgreSQL non supporta realmente lo standard SQL MULTISET operatore, né insiemi nidificati in generale. Potresti creare un ARRAY di ROW tipi come questo:
select array[row(1, 2), row(3, 4)]
E potresti anche annullare l'annidamento dell'array sopra
select * from unnest(array[row(1, 2), row(3, 4)]) t(a int, b int)
Quindi, se un ARRAY di ROW è accettabile per te, potresti scrivere qualcosa del genere:
select array_agg(row(a, b))
from (
select ...
) t(a, b)
Se hai il tuo OBJECT digita PostgreSQL, puoi eseguire il cast anonimo di ROW al tuo tipo:
select array_agg(row(a, b)::your_type)
from (
select ...
) t(a, b)