Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2016-01-22 Thread Vik Fearing
On 01/22/2016 04:28 AM, Tom Lane wrote: > Vik Fearing writes: >> I looked around for other places where this code should be used and >> didn't find any. I am marking this patch Ready for Committer. > > I pushed this with some adjustments, mainly to make sure that the >

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2016-01-21 Thread Vik Fearing
On 01/05/2016 09:07 AM, Vitaly Burovoy wrote: > On 1/4/16, Alvaro Herrera wrote: >> It seems we got majority approval on the design of this patch, and no >> disagreement; the last submitted version appears to implement that. >> There's no documentation change in the

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2016-01-21 Thread Tom Lane
Vik Fearing writes: > I looked around for other places where this code should be used and > didn't find any. I am marking this patch Ready for Committer. I pushed this with some adjustments, mainly to make sure that the erroneous-units errors exactly match those that would

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2016-01-21 Thread Vitaly Burovoy
On 1/21/16, Tom Lane wrote: > Vik Fearing writes: >> I looked around for other places where this code should be used and >> didn't find any. I am marking this patch Ready for Committer. > > I pushed this with some adjustments, mainly to make sure that

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2016-01-05 Thread Vitaly Burovoy
On 1/4/16, Alvaro Herrera wrote: > Vitaly Burovoy wrote: > >> Majority of the votes for NULL for "other things" except epoch. >> Nobody answers about differences between monotonic and oscillating >> values. >> >> I suppose behavior of monotonic values (julian, century,

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2016-01-04 Thread Alvaro Herrera
Vitaly Burovoy wrote: > Majority of the votes for NULL for "other things" except epoch. > Nobody answers about differences between monotonic and oscillating values. > > I suppose behavior of monotonic values (julian, century, decade, > isoyear, millennium and year) should be the same as for

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2015-11-18 Thread Torsten Zühlsdorff
On 17.11.2015 09:09, Vitaly Burovoy wrote: I suppose behavior of monotonic values (julian, century, decade, isoyear, millennium and year) should be the same as for epoch (which obviously also monotonic value). Proposed patch has that behavior: +/-infinity for epoch, julian, century, decade,

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2015-11-17 Thread Robert Haas
On Tue, Nov 17, 2015 at 10:57 AM, Tom Lane wrote: > Vitaly Burovoy writes: >> I suppose behavior of monotonic values (julian, century, decade, >> isoyear, millennium and year) should be the same as for epoch (which >> obviously also monotonic value).

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2015-11-17 Thread Tom Lane
Jim Nasby writes: > On 11/17/15 2:09 AM, Vitaly Burovoy wrote: >> Proposed patch has that behavior: ±infinity for epoch, julian, >> century, decade, isoyear, millennium and year; NULL for other fields. > What's the logic behind NULL here? Infinity is infinity, whether

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2015-11-17 Thread Tom Lane
Vitaly Burovoy writes: > I suppose behavior of monotonic values (julian, century, decade, > isoyear, millennium and year) should be the same as for epoch (which > obviously also monotonic value). > Proposed patch has that behavior: +/-infinity for epoch, julian, >

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2015-11-17 Thread Jim Nasby
On 11/17/15 2:09 AM, Vitaly Burovoy wrote: I suppose behavior of monotonic values (julian, century, decade, isoyear, millennium and year) should be the same as for epoch (which obviously also monotonic value). Proposed patch has that behavior: ±infinity for epoch, julian, century, decade,

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2015-11-17 Thread Vitaly Burovoy
On 11/9/15, Robert Haas wrote: > On Sat, Nov 7, 2015 at 9:47 AM, Vitaly Burovoy > wrote: >> I'd like to raise a topic about extracting fields from infinite >> timestamps, so much more that it is mentioned in the TODO list: >> "Determine how to

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2015-11-09 Thread Torsten Zuehlsdorff
On 09.11.2015 17:41, Tom Lane wrote: Kevin Grittner writes: On Monday, November 9, 2015 9:37 AM, Robert Haas wrote: That doesn't seem like enough consensus to commit this patch, which would change everything to +/-infinity. That particular choice

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2015-11-09 Thread Robert Haas
On Sat, Nov 7, 2015 at 9:47 AM, Vitaly Burovoy wrote: > I'd like to raise a topic about extracting fields from infinite > timestamps, so much more that it is mentioned in the TODO list: > "Determine how to represent date/time field extraction on infinite > timestamps". >

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2015-11-09 Thread Kevin Grittner
On Monday, November 9, 2015 9:37 AM, Robert Haas wrote: > On Sat, Nov 7, 2015 at 9:47 AM, Vitaly Burovoy > wrote: >> I'd like to raise a topic about extracting fields from infinite >> timestamps, so much more that it is mentioned in the TODO

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2015-11-09 Thread Kevin Grittner
> On Mon, Nov 9, 2015 at 8:22 AM, Kevin Grittner wrote: >> My first choice for other things would be NaN, but throwing an >> error instead would be OK. On Monday, November 9, 2015 10:41 AM, Tom Lane wrote: > What about returning NULL for the ill-defined

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2015-11-09 Thread Steve Crawford
I was unaware that we had +- infinity for numeric. select pg_typeof(extract(epoch from current_date)); pg_typeof -- double precision Given that null is a "special value that is used to indicate the absence of any data value" and that attributes like month or day-of-week will

Re: [HACKERS] Extracting fields from 'infinity'::TIMESTAMP[TZ]

2015-11-09 Thread Tom Lane
Kevin Grittner writes: > On Monday, November 9, 2015 9:37 AM, Robert Haas > wrote: >> That doesn't seem like enough consensus to commit this patch, which >> would change everything to +/-infinity. That particular choice >> wouldn't bother me much, but