Skip site navigation (1) Skip section navigation (2)

Re: Creating a selective aggregate ??

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Creating a selective aggregate ??
Date: 2004-07-03 14:31:32
Message-ID: 87oemxupq3.fsf@stark.xeocode.com (view raw or flat)
Thread:
Lists: pgsql-hackers
"Najib Abi Fadel" <nabifadel(at)usj(dot)edu(dot)lb> writes:

> Any ideas??
> Could this be done with aggregates ??

I think you're going to have to write code that reads all the records, keeps
state representing the current period start and the last seen end date and
outputs data every time it sees a gap like you want.

This could be a set returning plpgsql or plperl or plwhatever function, but it
may be easier to write it in your application level code.

-- 
greg


In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2004-07-03 14:54:21
Subject: Re: nested-xacts cursors (was Re: Performance with new nested-xacts code)
Previous:From: Michael BrusserDate: 2004-07-03 14:26:46
Subject: Re: Adding VERSION to startup log output

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group