Re: Infinite Interval

2023-11-18 Thread Joseph Koshakow
On Thu, Nov 16, 2023 at 2:03 AM Ashutosh Bapat wrote: > >On Tue, Nov 14, 2023 at 4:39 PM Dean Rasheed wrote: >> >> On Thu, 9 Nov 2023 at 12:49, Dean Rasheed wrote: >> > >> > OK, I have pushed 0001 and 0002. Here's the remaining (main) patch. >> > >> >> OK, I have

Re: Infinite Interval

2023-11-15 Thread Ashutosh Bapat
On Tue, Nov 14, 2023 at 4:39 PM Dean Rasheed wrote: > > On Thu, 9 Nov 2023 at 12:49, Dean Rasheed wrote: > > > > OK, I have pushed 0001 and 0002. Here's the remaining (main) patch. > > > > OK, I have now pushed the main patch. Thanks a lot Dean. -- Best Wishes, Ashutosh Bapat

Re: Infinite Interval

2023-11-14 Thread Dean Rasheed
On Thu, 9 Nov 2023 at 12:49, Dean Rasheed wrote: > > OK, I have pushed 0001 and 0002. Here's the remaining (main) patch. > OK, I have now pushed the main patch. Regards, Dean

Re: Infinite Interval

2023-11-09 Thread Dean Rasheed
On Thu, 9 Nov 2023 at 07:15, Ashutosh Bapat wrote: > > Just to test whether that bug fix also fixes the failure seen with > this patchset, I am attaching the patchset including the patch with > the fix. > > 0001 - fix in other thread > 0002 and 0003 are 0001 and 0002 in the previous patch set. >

Re: Infinite Interval

2023-11-08 Thread Dean Rasheed
On Wed, 8 Nov 2023 at 06:56, jian he wrote: > > > On Tue, 7 Nov 2023 at 14:33, Dean Rasheed wrote: > > > > Ah, Windows Server didn't like that. Trying again with "INT64CONST(0)" > > instead of just "0" in interval_um(). > > > I found this: > https://developercommunity.visualstudio.com/t/please-im

Re: Infinite Interval

2023-11-07 Thread jian he
On Wed, Nov 8, 2023 at 7:42 AM Dean Rasheed wrote: > > On Tue, 7 Nov 2023 at 14:33, Dean Rasheed wrote: > > > > New version attached doing that, to run it past the cfbot again. > > > > Ah, Windows Server didn't like that. Trying again with "INT64CONST(0)" > instead of just "0" in interval_um(). >

Re: Infinite Interval

2023-10-30 Thread jian he
On Mon, Oct 30, 2023 at 6:01 PM Ashutosh Bapat wrote: > > > Here's my version of commit message > > ``` > Support Infinite interval values > > Interval datatype uses the same input and output representation for > infinite intervals as other datatypes representing time that support > infinity. An i

Re: Infinite Interval

2023-10-27 Thread Ashutosh Bapat
On Fri, Oct 27, 2023 at 2:07 PM Dean Rasheed wrote: > > On Wed, 4 Oct 2023 at 14:29, Ashutosh Bapat > wrote: > > > > I think we should introduce interval_out_of_range_error() function on > > the lines of float_overflow_error(). Later patches introduce more > > places where we raise that error. We

Re: Infinite Interval

2023-10-27 Thread Dean Rasheed
On Wed, 4 Oct 2023 at 14:29, Ashutosh Bapat wrote: > > I think we should introduce interval_out_of_range_error() function on > the lines of float_overflow_error(). Later patches introduce more > places where we raise that error. We can introduce the function as > part of those patches. > I'm not

Re: Infinite Interval

2023-10-04 Thread Ashutosh Bapat
On Fri, Sep 29, 2023 at 12:43 PM Dean Rasheed wrote: > > I think that part is now ready to commit, and I plan to push this fix > to make_interval() separately, since it's really a bug-fix, not > related to support for infinite intervals. In line with recent > precedent, I don't think it's worth ba

Re: Infinite Interval

2023-09-22 Thread Ashutosh Bapat
On Fri, Sep 22, 2023 at 2:35 PM jian he wrote: > > /* TODO: Handle NULL inputs? */ > since interval_avg_serialize is strict, so handle null would be like: > if (PG_ARGISNULL(0)) then PG_RETURN_NULL(); That's automatically taken care of by the executor. Functions need to handle NULL inputs if they

Re: Infinite Interval

2023-09-22 Thread jian he
On Fri, Sep 22, 2023 at 3:49 PM Ashutosh Bapat wrote: > > On Thu, Sep 21, 2023 at 7:21 PM Ashutosh Bapat > wrote: > > > Hence I have changed interval_avg_deserialize() in 0007 to use > CurrentMemoryContext instead of aggcontext. Rest of the patches are > same as previous set. > > -- > Best Wishes

Re: Infinite Interval

2023-09-22 Thread Dean Rasheed
On Fri, 22 Sept 2023 at 08:49, Ashutosh Bapat wrote: > > Following code in ExecInterpExpr makes it clear that the > deserialization function is be executed in per tuple memory context. > Whereas the aggregate's context is different from this context and may > lives longer that the context in which

Re: Infinite Interval

2023-09-21 Thread Ashutosh Bapat
On Wed, Sep 20, 2023 at 8:23 PM Dean Rasheed wrote: > > On Wed, 20 Sept 2023 at 15:00, Ashutosh Bapat > wrote: > > > > 0005 - Refactored Jian's code fixing window functions. Does not > > contain the changes for serialization and deserialization. Jian, > > please let me know if I have missed anyth

Re: Infinite Interval

2023-09-20 Thread jian he
> On Wed, 20 Sept 2023 at 15:00, Ashutosh Bapat > wrote: > > > > 0005 - Refactored Jian's code fixing window functions. Does not > > contain the changes for serialization and deserialization. Jian, > > please let me know if I have missed anything else. > > attached serialization and deserializati

Re: Infinite Interval

2023-09-20 Thread Dean Rasheed
On Wed, 20 Sept 2023 at 15:00, Ashutosh Bapat wrote: > > 0005 - Refactored Jian's code fixing window functions. Does not > contain the changes for serialization and deserialization. Jian, > please let me know if I have missed anything else. > That looks a lot neater. One thing I don't care for is

Re: Infinite Interval

2023-09-20 Thread Ashutosh Bapat
On Wed, Sep 20, 2023 at 5:44 PM Dean Rasheed wrote: > > On Wed, 20 Sept 2023 at 13:09, Dean Rasheed wrote: > > > > So basically, do_interval_accum() could be simplified to: > > > > Oh, and I guess it also needs an INTERVAL_NOT_FINITE() check, to make > sure that finite values don't sum to our rep

Re: Infinite Interval

2023-09-20 Thread Ashutosh Bapat
On Mon, Sep 18, 2023 at 5:09 PM Dean Rasheed wrote: > > On Wed, 13 Sept 2023 at 11:13, Ashutosh Bapat > wrote: > > > > On Tue, Sep 12, 2023 at 2:39 PM Dean Rasheed > > wrote: > > > > > > and it looks like the infinite interval > > > input code is broken. > > > > The code required to handle 'inf

Re: Infinite Interval

2023-09-20 Thread Dean Rasheed
On Wed, 20 Sept 2023 at 13:09, Dean Rasheed wrote: > > So basically, do_interval_accum() could be simplified to: > Oh, and I guess it also needs an INTERVAL_NOT_FINITE() check, to make sure that finite values don't sum to our representation of infinity, as in interval_pl(). Regards, Dean

Re: Infinite Interval

2023-09-20 Thread Dean Rasheed
On Wed, 20 Sept 2023 at 11:27, jian he wrote: > > if I remove IntervalAggState's element: MemoryContext, it will not work. > so I don't understand what the above sentence means.. Sorry. (it's > my problem) > I don't see why it won't work. The point is to try to simplify do_interval_accum() as

Re: Infinite Interval

2023-09-19 Thread Dean Rasheed
On Sat, 16 Sept 2023 at 01:00, jian he wrote: > > I refactor the avg(interval), sum(interval), so moving aggregate, > plain aggregate both work with +inf/-inf. > no performance degradation, in fact, some performance gains. > I haven't reviewed this part in any detail yet, but I can confirm that t

Re: Infinite Interval

2023-09-18 Thread Dean Rasheed
On Wed, 13 Sept 2023 at 11:13, Ashutosh Bapat wrote: > > On Tue, Sep 12, 2023 at 2:39 PM Dean Rasheed wrote: > > > > and it looks like the infinite interval > > input code is broken. > > The code required to handle 'infinity' as an input value was removed by > d6d1430f404386162831bc32906ad174b200

Re: Infinite Interval

2023-09-18 Thread Ashutosh Bapat
On Thu, Sep 14, 2023 at 11:58 AM jian he wrote: > > - decade, century, and > millennium). > + decade, century, and > millennium > + for all types and hour and > day just for interval). It seems you have changed a paragraph from https://www.postgresql.org/docs/current/datatype-datetime

Re: Infinite Interval

2023-09-13 Thread jian he
On Wed, Sep 13, 2023 at 6:13 PM Ashutosh Bapat wrote: > > to sum(). I am planning to work on this next week but in case somebody > else wants to pick this up here are patches with other things fixed. > > -- > Best Wishes, > Ashutosh Bapat hi. some doc issues. - decade, century, and millenni

Re: Infinite Interval

2023-09-12 Thread Dean Rasheed
On Thu, 24 Aug 2023 at 14:51, Ashutosh Bapat wrote: > > The patches still apply. But here's a rebased version with one white > space error fixed. Also ran pgindent. > This needs another rebase, and it looks like the infinite interval input code is broken. I took a quick look, and had a couple of

Re: Infinite Interval

2023-07-08 Thread Tom Lane
Ashutosh Bapat writes: > Fixed assertion in time_mi_time(). It needed to assert that the result > is FINITE but it was doing the other way round and that triggered some > failures in cfbot. It's still not passing in the cfbot, at least not on any non-Linux platforms. I believe the reason is that

Re: Infinite Interval

2023-04-12 Thread Ashutosh Bapat
On Sat, Apr 8, 2023 at 8:54 PM Joseph Koshakow wrote: > > I was also unable to find a definition of oscillating or monotonically > increasing in this context. I used the existing timestamps and dates > code to form my own definition: > > If there exists an two intervals with the same sign, such th

Re: Infinite Interval

2023-04-03 Thread Ashutosh Bapat
Hi Joseph, On Mon, Apr 3, 2023 at 6:02 AM Joseph Koshakow wrote: > > I've attached a patch with all of the errcontext calls removed. None of > the existing out of range errors have an errdetail call so I think this > is more consistent. If we do want to add errdetail, then we should > probably

Re: Infinite Interval

2023-04-03 Thread Ashutosh Bapat
Hi Joseph, thanks for addressing comments. On Sat, Apr 1, 2023 at 10:53 PM Joseph Koshakow wrote: > So I added a check for FLOAT8_FITS_IN_INT64() and a test with this > scenario. I like that. Thanks. > > For what it's worth I think that 2147483647 months only became a valid > interval in v15 as

Re: Infinite Interval

2023-04-02 Thread Joseph Koshakow
On Sun, Apr 2, 2023 at 6:54 PM Tom Lane wrote: > >Joseph Koshakow writes: >>> I've added an errcontext to all the errors of the form "X out of >>> range". > >Please note the style guidelines [1]: > >errcontext(const char *msg, ...) is not normally called directly from >

Re: Infinite Interval

2023-04-02 Thread Tom Lane
Joseph Koshakow writes: >> I've added an errcontext to all the errors of the form "X out of >> range". Please note the style guidelines [1]: errcontext(const char *msg, ...) is not normally called directly from an ereport message site; rather it is used in error_context_stack callbac

Re: Infinite Interval

2023-04-02 Thread Joseph Koshakow
>On Sun, Apr 2, 2023 at 5:36 PM Tom Lane wrote: > >Joseph Koshakow writes: >> I've attached a patch with these changes that is meant to be applied >> over the previous three patches. Let me know what you think. > >Does not really seem like an improvement to me --- I think it's >

Re: Infinite Interval

2023-04-02 Thread Tom Lane
Joseph Koshakow writes: > I've attached a patch with these changes that is meant to be applied > over the previous three patches. Let me know what you think. Does not really seem like an improvement to me --- I think it's adding more complexity than it removes. The changes in CONTEXT messages ar

Re: Infinite Interval

2023-04-02 Thread Joseph Koshakow
> > This code is duplicated in timestamp_pl_interval(). We could create a function > > to encode the infinity handling rules and then call it in these two places. The > > argument types are different, Timestamp and TimestampTz viz. which map to in64, > > so shouldn't be a problem. But it will be sl

Re: Infinite Interval

2023-03-31 Thread Ashutosh Bapat
I hurried too much on the previous patch. It introduced other problems. Attached is a better patch and also fixes problem below #select 'infinity'::interval * 0; ?column? -- infinity (1 row) with the patch we see #select 'infinity'::interval * 0; 2023-03-31 18:00:43.131 IST [240892] ERRO

Re: Infinite Interval

2023-03-31 Thread Ashutosh Bapat
On Tue, Mar 28, 2023 at 7:17 PM Ashutosh Bapat wrote: > make sure that every > operator that interval as one of its operands or the result has been > covered in the code. time_mi_time - do we want to add an Assert to make sure that this function does not produce an Interval structure which looks

Re: Infinite Interval

2023-03-28 Thread Ashutosh Bapat
On Mon, Mar 20, 2023 at 3:16 AM Joseph Koshakow wrote: > > > > On Sun, Mar 19, 2023 at 5:13 PM Tom Lane wrote: > > > >Did you actually write "if TIMESTAMP_IS_NOBEGIN(dt2)" and not > >"if (TIMESTAMP_IS_NOBEGIN(dt2))"? If the former, I'm not surprised > >that pgindent gets confused. T

Re: Infinite Interval

2023-03-28 Thread Ashutosh Bapat
On Sun, Mar 26, 2023 at 1:28 AM Tom Lane wrote: > > I think you can take it as read that simple C test programs on modern > platforms will exhibit IEEE-compliant handling of float infinities. > For the record, I tried the attached. It gives a warning at compilation time. $gcc float_inf.c float_i

Re: Infinite Interval

2023-03-28 Thread Ashutosh Bapat
On Sun, Mar 19, 2023 at 12:18 AM Joseph Koshakow wrote: > > The problem is that `secs = rint(secs)` rounds the seconds too early > and loses any fractional seconds. Do we have an overflow detecting > multiplication function for floats? We have float8_mul() which checks for overflow. typedef doubl

Re: Infinite Interval

2023-03-27 Thread Ashutosh Bapat
On Sat, Mar 25, 2023 at 9:13 PM Joseph Koshakow wrote: > > On Fri, Mar 24, 2023 at 9:43 AM Ashutosh Bapat > wrote: > > > >You don't need to do this, but looks like we can add DAYS_PER_WEEK macro > > and > >use it here. > > I've attached a patch with this new macro. There's probably tons

Re: Infinite Interval

2023-03-25 Thread Isaac Morland
On Sat, 25 Mar 2023 at 15:59, Tom Lane wrote: > Joseph Koshakow writes: > > In terms of adding/subtracting infinities, the IEEE standard is pay > > walled and I don't have a copy. I tried finding information online but > > I also wasn't able to find anything useful. I additionally checked to see

Re: Infinite Interval

2023-03-25 Thread Tom Lane
Joseph Koshakow writes: > In terms of adding/subtracting infinities, the IEEE standard is pay > walled and I don't have a copy. I tried finding information online but > I also wasn't able to find anything useful. I additionally checked to see > the results of C++, C, and Java, and they all match w

Re: Infinite Interval

2023-03-25 Thread Joseph Koshakow
In terms of adding/subtracting infinities, the IEEE standard is pay walled and I don't have a copy. I tried finding information online but I also wasn't able to find anything useful. I additionally checked to see the results of C++, C, and Java, and they all match which increases my confidence that

Re: Infinite Interval

2023-03-25 Thread Joseph Koshakow
On Fri, Mar 24, 2023 at 9:43 AM Ashutosh Bapat wrote: > >You don't need to do this, but looks like we can add DAYS_PER_WEEK macro and >use it here. I've attached a patch with this new macro. There's probably tons of places it can be used instead of hardcoding the number 7, but I'll save t

Re: Infinite Interval

2023-03-24 Thread Ashutosh Bapat
On Sun, Mar 19, 2023 at 1:04 AM Joseph Koshakow wrote: > > The patches in this email should be rebased over master. > Reviewed 0001 - Looks good to me. The new function is properly placed along with other signed 64 bit functions. All existing calls to int64_multiply_add() have been replaced with

Re: Infinite Interval

2023-03-19 Thread Joseph Koshakow
On Sun, Mar 19, 2023 at 5:13 PM Tom Lane wrote: > >Did you actually write "if TIMESTAMP_IS_NOBEGIN(dt2)" and not >"if (TIMESTAMP_IS_NOBEGIN(dt2))"? If the former, I'm not surprised >that pgindent gets confused. The parentheses are required by the >C standard. Your code might acc

Re: Infinite Interval

2023-03-19 Thread Tom Lane
Joseph Koshakow writes: > I must have been doing something wrong because I tried again today and > it worked fine. However, I go get a lot of changes like the following: > - if TIMESTAMP_IS_NOBEGIN(dt2) > - ereport(ERROR, > - > (errcode(ERRCODE_DATETIME_V

Re: Infinite Interval

2023-03-19 Thread Joseph Koshakow
On Sat, Mar 18, 2023 at 3:55 PM Tom Lane wrote: > >Joseph Koshakow writes: >> On Sat, Mar 18, 2023 at 3:08 PM Tom Lane wrote: >>> More specifically, those are from running pg_indent with an obsolete >>> typedefs list. > >> I must be doing something wrong because even after do

Re: Infinite Interval

2023-03-18 Thread Tom Lane
Joseph Koshakow writes: > On Sat, Mar 18, 2023 at 3:08 PM Tom Lane wrote: >> More specifically, those are from running pg_indent with an obsolete >> typedefs list. > I must be doing something wrong because even after doing that I get the > same strange formatting. Specifically from the root dire

Re: Infinite Interval

2023-03-18 Thread Joseph Koshakow
On Sat, Mar 18, 2023 at 3:08 PM Tom Lane wrote: > Joseph Koshakow writes: >> On Thu, Mar 9, 2023 at 12:42 PM Ashutosh Bapat < ashutosh.bapat@gmail.com> >> wrote: >>> There are a lot of these diffs. PG code doesn't leave an extra space >>> between variable name and *. > >> Those appeared from

Re: Infinite Interval

2023-03-18 Thread Tom Lane
Joseph Koshakow writes: > On Thu, Mar 9, 2023 at 12:42 PM Ashutosh Bapat > wrote: >> There are a lot of these diffs. PG code doesn't leave an extra space >> between variable name and *. > Those appeared from running pg_indent. I've removed them all. More specifically, those are from running pg_

Re: Infinite Interval

2023-03-09 Thread Ashutosh Bapat
Hi Joseph, Thanks for working on the patch. Sorry for taking so long to review this patch. But here's it finally, review of code changes static pg_tz *FetchDynamicTimeZone(TimeZoneAbbrevTable *tbl, const datetkn *tp, - DateTimeErrorExtra *extra); +

Re: Infinite Interval

2023-03-01 Thread Joseph Koshakow
On Wed, Mar 1, 2023 at 3:03 PM Gregory Stark (as CFM) wrote: > >It looks like this patch needs a (perhaps trivial) rebase. Attached is a rebased patch. >It sounds like all the design questions are resolved so perhaps this >can be set to Ready for Committer once it's rebased? There h

Re: Infinite Interval

2023-03-01 Thread Gregory Stark (as CFM)
On Sun, 15 Jan 2023 at 11:44, Joseph Koshakow wrote: > > On Sat, Jan 14, 2023 at 4:22 PM Joseph Koshakow wrote: > I've gone ahead and updated the patch to only look at the months field. > I'll submit this email and patch to the Feb commitfest. It looks like this patch needs a (perhaps trivial)

Re: Infinite Interval

2023-01-15 Thread Joseph Koshakow
On Sat, Jan 14, 2023 at 4:22 PM Joseph Koshakow wrote: > > At this point the patch is ready for review again except for the one > outstanding question of: Should finite checks on intervals only look at > months or all three fields? > > - Joe I've gone ahead and updated the patch to only look at t

Re: Infinite Interval

2023-01-14 Thread Joseph Koshakow
Ok, I've updated the patch to handle every function that inputs or outputs intervals, as well as added some tests. In the process I noticed that some of the existing date/timestamp/timestamptz don't handle infinite values properly. For example, postgres=# SELECT age('infinity'::timestamp); age

Re: Infinite Interval

2023-01-10 Thread Joseph Koshakow
On Sun, Jan 8, 2023 at 11:17 PM jian he wrote: > > > > On Sun, Jan 8, 2023 at 4:22 AM Joseph Koshakow wrote: >> >> On Sat, Jan 7, 2023 at 3:05 PM Joseph Koshakow wrote: >> > >> > On Sat, Jan 7, 2023 at 3:04 PM Joseph Koshakow wrote: >> > > >> > > I think this patch is just about ready for revie

Re: Infinite Interval

2023-01-08 Thread jian he
On Sun, Jan 8, 2023 at 4:22 AM Joseph Koshakow wrote: > On Sat, Jan 7, 2023 at 3:05 PM Joseph Koshakow wrote: > > > > On Sat, Jan 7, 2023 at 3:04 PM Joseph Koshakow > wrote: > > > > > > I think this patch is just about ready for review, except for the > > > following two questions: > > > 1. S

Re: Infinite Interval

2023-01-07 Thread Joseph Koshakow
On Sat, Jan 7, 2023 at 3:05 PM Joseph Koshakow wrote: > > On Sat, Jan 7, 2023 at 3:04 PM Joseph Koshakow wrote: > > > > I think this patch is just about ready for review, except for the > > following two questions: > > 1. Should finite checks on intervals only look at months or all three > >

Re: Infinite Interval

2023-01-07 Thread Joseph Koshakow
On Sat, Jan 7, 2023 at 3:04 PM Joseph Koshakow wrote: > > On Thu, Jan 5, 2023 at 11:30 PM jian he wrote: > > > > > > > > On Fri, Jan 6, 2023 at 6:54 AM Joseph Koshakow wrote: > >> > >> Looks like some of the error messages have changed and we > >> have some issues with parsing "+infinity" after

Re: Infinite Interval

2023-01-07 Thread Joseph Koshakow
On Thu, Jan 5, 2023 at 11:30 PM jian he wrote: > > > > On Fri, Jan 6, 2023 at 6:54 AM Joseph Koshakow wrote: >> >> Looks like some of the error messages have changed and we >> have some issues with parsing "+infinity" after rebasing. > > > There is a commit 2ceea5adb02603ef52579b568ca2c5aebed8735

Re: Infinite Interval

2023-01-05 Thread jian he
On Fri, Jan 6, 2023 at 6:54 AM Joseph Koshakow wrote: > Jian, > > I incorporated your changes and updated interval.out and ran > pgindent. Looks like some of the error messages have changed and we > have some issues with parsing "+infinity" after rebasing. > > - Joe > Looks like some of the erro

Re: Infinite Interval

2023-01-05 Thread Joseph Koshakow
Jian, I incorporated your changes and updated interval.out and ran pgindent. Looks like some of the error messages have changed and we have some issues with parsing "+infinity" after rebasing. - Joe From 4bf672f9079322cffde635dff2078582fca55f09 Mon Sep 17 00:00:00 2001 From: Joseph Koshakow Date

Re: Infinite Interval

2023-01-05 Thread Joseph Koshakow
On Thu, Jan 5, 2023 at 5:20 AM jian he wrote: > > > > On Wed, Jan 4, 2023 at 10:13 PM jian he wrote: >> >> >> >> I don't know how to generate an interval.out file. Personally I just write the .out files manually. I think it especially helps as a way to double-check that the results are what you

Re: Infinite Interval

2023-01-05 Thread jian he
On Wed, Jan 4, 2023 at 10:13 PM jian he wrote: > > > On Tue, Jan 3, 2023 at 6:14 AM Joseph Koshakow wrote: > >> I have another patch, this one adds validations to operations that >> return intervals and updated error messages. I tried to give all of the >> error messages meaningful text, but I'm

Re: Infinite Interval

2023-01-04 Thread jian he
On Tue, Jan 3, 2023 at 6:14 AM Joseph Koshakow wrote: > I have another patch, this one adds validations to operations that > return intervals and updated error messages. I tried to give all of the > error messages meaningful text, but I'm starting to think that almost all > of them should just sa

Re: Infinite Interval

2023-01-02 Thread Joseph Koshakow
I have another patch, this one adds validations to operations that return intervals and updated error messages. I tried to give all of the error messages meaningful text, but I'm starting to think that almost all of them should just say "interval out of range". The current approach may reveal some

Re: Infinite Interval

2023-01-02 Thread Joseph Koshakow
On Mon, Jan 2, 2023 at 1:21 PM Joseph Koshakow wrote: > > On Sat, Dec 31, 2022 at 12:09 AM jian he wrote: > > In float8, select float8 'inf' / float8 'inf' return NaN. Now in your patch > > select interval 'infinity' / float8 'infinity'; returns infinity. > > I am not sure it's right. I found t

Re: Infinite Interval

2023-01-02 Thread Joseph Koshakow
On Sat, Dec 31, 2022 at 12:09 AM jian he wrote: > In float8, select float8 'inf' / float8 'inf' return NaN. Now in your patch > select interval 'infinity' / float8 'infinity'; returns infinity. > I am not sure it's right. I found this related post > (https://math.stackexchange.com/questions/181

Re: Infinite Interval

2022-12-31 Thread Vik Fearing
On 12/31/22 06:09, jian he wrote: Since in float8 you can use '+inf', '+infinity', So should we also make interval '+infinity' valid? Yes. Also in timestamp. '+infinity'::timestamp is invalid, should we make it valid. Yes, we should. I wrote a trivial patch for this a while ago but it ap

Re: Infinite Interval

2022-12-30 Thread jian he
On Fri, Dec 30, 2022 at 10:47 PM Joseph Koshakow wrote: > I have another update, I cleaned up some of the error messages, fixed > the horology tests, and ran pgindent. > > - Joe > Hi, there. Since in float8 you can use '+inf', '+infinity', So should we also make interval '+infinity' valid? Also

Re: Infinite Interval

2022-12-30 Thread Joseph Koshakow
I have another update, I cleaned up some of the error messages, fixed the horology tests, and ran pgindent. - Joe From 518c59be586abf5779c5727c2117b6a46b466503 Mon Sep 17 00:00:00 2001 From: Joseph Koshakow Date: Sat, 17 Dec 2022 14:21:26 -0500 Subject: [PATCH] This is WIP. Following things are

Re: Infinite Interval

2022-12-23 Thread Joseph Koshakow
Hi Ashutosh, I ended up doing some more work on this today. All of the major features should be implemented now. Below are what I think are the outstanding TODOs: - Clean up error messages and error codes - Figure out how to correctly implement interval_part for infinite intervals. For now I prett

Re: Infinite Interval

2022-12-17 Thread Joseph Koshakow
On Sat, Dec 17, 2022 at 2:34 PM Joseph Koshakow wrote: > > Hi Ashutosh, > > I've added tests for all the operators and functions involving > intervals and what I think the expected behaviors to be. The > formatting might be slightly off and I've left the contents of the > error messages as TODOs.

Re: Infinite Interval

2022-12-17 Thread Joseph Koshakow
Hi Ashutosh, I've added tests for all the operators and functions involving intervals and what I think the expected behaviors to be. The formatting might be slightly off and I've left the contents of the error messages as TODOs. Hopefully it's a good reference for the implementation. > Adding inf

Re: Infinite Interval

2022-12-15 Thread Joseph Koshakow
On Mon, Dec 12, 2022 at 8:05 AM Ashutosh Bapat wrote: > > Hi Joseph, > I stumbled upon this requirement a few times. So I started working on > this support in my spare time as a hobby project to understand > horology code in PostgreSQL. This was sitting in my repositories for > more than an year.

Re: Infinite Interval

2022-12-12 Thread Ashutosh Bapat
Hi Joseph, I stumbled upon this requirement a few times. So I started working on this support in my spare time as a hobby project to understand horology code in PostgreSQL. This was sitting in my repositories for more than an year. Now that I have someone else showing an interest, it's time for it