Re: Revisiting extract(epoch from timestamp) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Revisiting extract(epoch from timestamp)
Date
Msg-id 12254.1334001384@sss.pgh.pa.us
Whole thread Raw
In response to Re: Revisiting extract(epoch from timestamp)  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Excerpts from Tom Lane's message of lun abr 09 15:38:21 -0300 2012:
>> What exactly would you do with it there that you couldn't do more easily
>> and clearly with plain timestamp comparisons?  I'm willing to be
>> convinced, but I want to see a case where it really is the best way.

> You mean, having the constraint declaration rotate the timestamptz
> column to timestamp and then extract the epoch from that?  If you go
> that route, then the queries that wish to take advantage of constraint
> exclusion would have to do likewise, which becomes ugly rather quickly.

No, I'm wondering why the partition constraints wouldn't just be
tstzcol >= '2012-04-01 00:00' and tstzcol < '2012-05-01 00:00'

or similar.  What sort of constraint have you got in mind that is more
naturally expressed involving extract(epoch)?  (And will the planner
think so too?)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: should encoding names be quoted in error messages?
Next
From: Robert Haas
Date:
Subject: Re: bug in fast-path locking