Re: SQL:2011 PERIODS vs Postgres Ranges?

From: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
To: David Steele <david(at)pgmasters(dot)net>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SQL:2011 PERIODS vs Postgres Ranges?
Date: 2019-05-19 07:11:20
Message-ID: CA+renyVr9edbuCVUrk03yUPp-hs7ASQO+mEcLW5SzCWi8-ULog@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Mar 9, 2019 at 10:42 PM David Steele <david(at)pgmasters(dot)net> wrote:
> On 3/10/19 2:41 AM, Paul A Jungwirth wrote:
> > I'm pretty far along
> > with an add-on patch to create temporal *foreign* keys too, which I
> > think should be part of this same bundle of work.

Here is that patch. I've changed the title from "temporal_pks" to
"temporal_fks" but it includes both.

I've rebased on top of latest master, but also the patch assumes my
other range_agg patch is already included. (I use range_agg to help
implement the foreign key checks.)

This patch is hopefully getting close, but I'd still call it a WIP. It
has docs and tests, but it hasn't had any review yet (and neither has
range_agg). Here are a few limitations:

- It supports only range types, not SQL:2011 PERIODs. I'd like to add
PERIODs too, but that seems like a major undertaking. I would probably
need to partner with someone more experienced to get it done. Maybe it
should be a separate CF entry.
- The foreign keys support only NO ACTION and RESTRICT, not
CASCADE/SET NULL/SET DEFAULT. The latter options are hard to implement
now but would be trivial after adding UPDATE/DELETE FROM t FOR PORTION
OF r FROM t1 TO t2, so I'm thinking that will be next on my list. :-)
- I'm sure there are plenty of errors & infelicities people more
knowledgeable than me can point out.

Any feedback is gratefully welcomed. :-)

Yours,
Paul

Attachment Content-Type Size
temporal_fks_v0001.patch application/octet-stream 116.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2019-05-19 08:18:38 Re: Statistical aggregate functions are not working with PARTIAL aggregation
Previous Message David Rowley 2019-05-19 04:37:48 Re: Statistical aggregate functions are not working with PARTIAL aggregation