From: | Tim Landscheidt <tim(at)tim-landscheidt(dot)de> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Procedure for feature requests? |
Date: | 2009-10-13 22:22:04 |
Message-ID: | m3my3v53zn.fsf@passepartout.tim-landscheidt.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Sam Mason <sam(at)samason(dot)me(dot)uk> wrote:
>> >> "generate_series(A, B, C)" can also
>> >> be written as "A + generate_series(0, (C - B) / C) * C"
>> >
>> > If you can figure out the limit then it seems easy,
>> > though I'm not sure how you'd do that.
>> What limit?
> Sorry, I was calling the second parameter to generate_series the "limit".
> Calculating "(C - B) / C" isn't easy for timestamps, whereas it's easy
> for dates. I believe this is why there's a specific version for the
> former but not the latter.
(I obviously meant "(B - A) / C" :-).) Is it? I would assume
that you just have to convert A, B and C to seconds (since
epoch) and then use a normal integer division.
> [...]
>> "generate_series(DATE, DATE)" would just be syntactic sugar,
>> and I like sweets.
> We all do, but in software it's got to be balanced against the overhead
> of maintaining support for these functions.
My knowledge of PostgreSQL's codebase is nonexistent, so I
do not know how unstable it is.
Tim
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Kellerer | 2009-10-13 22:26:30 | Re: Query to find contiguous ranges on a column |
Previous Message | Tim Landscheidt | 2009-10-13 22:12:58 | Re: Query to find contiguous ranges on a column |