Does anybody have a stored proc they'd like to share (preferably pl/ pgsql) that generates the power set of an array? For instance:
select powerset({1,2,3});
....would give 8 rows:
{}{1}{2}{3}{1,2}{2,3}{1,3}{1,2,3}