Subject: Re: SQL:2011 PERIODS vs Postgres Ranges?

From: Michael Paquier <[email-masked]>
Date: Thu, 17 Sep 2020 16:51:01 +0900

On Wed, Mar 11, 2020 at 04:27:53PM -0700, Paul A Jungwirth wrote:
> Here is a patch rebasing on master (meant to be applied on top of my
> other multirange patch) and newly including UPDATE/DELETE FOR PORTION
> OF. FOR PORTION OF works on any table with a temporal primary key. It
> restricts the UPDATE/DELETE to the given time frame, and then if the
> affected row(s) had any "leftovers" above or below the targeted range,
> it INSERTs new rows to preserve the untouched intervals.

This patch had no reviews, unfortunately it cannot be applied
cleanly.  Could you send a rebase please?
--
Michael

---

From: Michael Paquier <[email-masked]>
Date: Wed, 30 Sep 2020 16:39:08 +0900

> cleanly.  Could you send a rebase please?

This had no replies after two weeks, so I have marked the patch as
RwF.  Please feel free to resubmit if you are planning to work more on
that.
--
Michael

---

From: Ibrar Ahmed <[email-masked]>
Date: Tue, 27 Oct 2020 19:11:02 +0500

> RwF.  Please feel free to resubmit if you are planning to work more on

I have spent some more time on the patch and did a lot of cleanup along
with some fixes, compilation errors, and warnings. There is a need for
another round of clean up to make that patch perfect. Currently, it based
on master (0525572860335d050a1bea194a5278c8833304d1). Regression is not
passing because it is dependent on the range_agg patch. Currently, I am
collecting all the TODO's and try to finish all of these.

The patch requires some reviews, so I am putting that again in the current
commitfest.

-- 
Ibrar Ahmed

---

From: Paul Jungwirth <[email-masked]>
Date: Tue, 27 Oct 2020 09:34:48 -0700

On 10/27/20 7:11 AM, Ibrar Ahmed wrote:
> with some fixes, compilation errors, and warnings.

Thank you for taking a look at this! I've been swamped with ordinary 
work and haven't had a chance to focus on it for a while, but I'm hoping 
to make some improvements over the coming holidays, especially based on 
feedback from my talk at PgCon. There are a handful of small specific 
things I'd like to do, and then one big thing: add support for PERIODs. 
Vik said I could include his old patch for PERIODs, so I'd like to get 
that working on the latest master, and then rebase my own work on top of 
it. Then we can accept either ranges or PERIODs in various places 
(marked by TODOs in the code).

Vik also pointed out a way to check foreign keys without using 
range_agg. He thinks it may even be more efficient. On the other hand 
it's a much more complicated SQL statement. I'd like to do a performance 
comparison to get concrete numbers, but if we did use his query, then 
this patch wouldn't depend on multiranges anymore---which seems like a 
big aid to moving it forward. Assuming multiranges gets committed, we 
can always swap in the range_agg query depending on the performance 
comparison results.

I apologize for the slow progress here, and thank you for your help!

Yours,

-- 
Paul              ~{:-)
[email-masked]