powerset?

From: Ben <bench(at)silentmedia(dot)com>
To: "PostgreSQL General ((EN))" <pgsql-general(at)postgresql(dot)org>
Subject: powerset?
Date: 2006-09-23 06:38:12
Message-ID: CED3A96A-7A8A-4F3F-8072-D417A5169C3B@silentmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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}

Responses

Browse pgsql-general by date

  From Date Subject
Next Message zeljko 2006-09-23 18:07:22 How to avoid error with convert() function
Previous Message Guy Rouillier 2006-09-23 03:07:57 Re: Can i switch to the use of persistent connections with my already in use application without worrying ?