Re: [HACKERS] Revisiting extract(epoch from timestamp)

2012-04-09 Thread Tom Lane
Alvaro Herrera 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

Re: [HACKERS] Revisiting extract(epoch from timestamp)

2012-04-09 Thread Alvaro Herrera
Excerpts from Tom Lane's message of lun abr 09 15:38:21 -0300 2012: > > Alvaro Herrera writes: > >> Robert Haas writes: > >>> If somebody needs it I'd probably be in favor of doing it. I'm not > >>> sure I'd do it on spec. > > > It would be useful to have a simple function to use with timesta

Re: [HACKERS] Revisiting extract(epoch from timestamp)

2012-04-09 Thread Tom Lane
Alvaro Herrera writes: >> Robert Haas writes: >>> If somebody needs it I'd probably be in favor of doing it. I'm not >>> sure I'd do it on spec. > It would be useful to have a simple function to use with timestamp in > constraint exclusion without having to use contorted expressions ... > An im

Re: [HACKERS] Revisiting extract(epoch from timestamp)

2012-04-09 Thread Alvaro Herrera
Excerpts from Tom Lane's message of lun abr 09 15:04:10 -0300 2012: > Robert Haas writes: > > On Mon, Apr 9, 2012 at 1:30 PM, Tom Lane wrote: > >> http://archives.postgresql.org/pgsql-general/2012-01/msg00649.php > >> The above-linked discussion also brings up a different point, which is > >> th

Re: [HACKERS] Revisiting extract(epoch from timestamp)

2012-04-09 Thread Tom Lane
"Greg Sabino Mullane" writes: >> so that we could mark it immutable. On the other hand, it's not >> entirely apparent why people would need to create indexes on the epoch >> value rather than just indexing the timestamp itself > Well, it makes for smaller indexes if you don't really care about

Re: [HACKERS] Revisiting extract(epoch from timestamp)

2012-04-09 Thread Tom Lane
Robert Haas writes: > On Mon, Apr 9, 2012 at 1:30 PM, Tom Lane wrote: >> http://archives.postgresql.org/pgsql-general/2012-01/msg00649.php >> The above-linked discussion also brings up a different point, which is >> that extracting the epoch from a timestamptz is an immutable operation, >> but be

Re: [HACKERS] Revisiting extract(epoch from timestamp)

2012-04-09 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 > so that we could mark it immutable. On the other hand, it's not > entirely apparent why people would need to create indexes on the epoch > value rather than just indexing the timestamp itself Well, it makes for smaller indexes if you don't r

Re: [HACKERS] Revisiting extract(epoch from timestamp)

2012-04-09 Thread Robert Haas
On Mon, Apr 9, 2012 at 1:30 PM, Tom Lane wrote: > A long time ago, we had this bug report: > http://archives.postgresql.org/pgsql-bugs/2003-02/msg00069.php > in consequence of which, I changed timestamp_part() so that it would > rotate a timestamp-without-timezone from the local timezone to GMT >

[HACKERS] Revisiting extract(epoch from timestamp)

2012-04-09 Thread Tom Lane
A long time ago, we had this bug report: http://archives.postgresql.org/pgsql-bugs/2003-02/msg00069.php in consequence of which, I changed timestamp_part() so that it would rotate a timestamp-without-timezone from the local timezone to GMT before extracting the epoch offset (commit 191ef2b407f06554