Re: powerset? - Mailing list pgsql-general

From Michael Fuhr
Subject Re: powerset?
Date
Msg-id 20060924150223.GA28717@winnie.fuhr.org
Whole thread Raw
In response to Re: powerset?  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
On Sat, Sep 23, 2006 at 11:47:59PM -0600, Michael Fuhr wrote:
>     FOR i IN 0 .. (1 << (aupper - alower + 1)) - 1 LOOP

To handle empty arrays this should be:

FOR i IN 0 .. COALESCE((1 << (aupper - alower + 1)) - 1, 0) LOOP

--
Michael Fuhr

pgsql-general by date:

Previous
From: Jon Lapham
Date:
Subject: Restart after poweroutage
Next
From: Richard Broersma Jr
Date:
Subject: Re: Restart after poweroutage