proposal: operator exclusion constraints with cardinality - Mailing list pgsql-hackers

From Jeff Davis
Subject proposal: operator exclusion constraints with cardinality
Date
Msg-id 1257119697.27737.214.camel@jdavis
Whole thread Raw
Responses Re: proposal: operator exclusion constraints with cardinality
List pgsql-hackers
I have completed the open issues (that I'm aware of) for operator
exclusion constraints:

http://archives.postgresql.org/message-id/1257101600.27737.159.camel@jdavis

I'd now like to propose an extension to that feature: cardinality
limits.

It could go something like this (syntax still open for discussion, for
illustration only):
 EXCLUSION (room     CHECK WITH =,            attendee CHECK WITH =,            during   CHECK WITH &&)   CARDINALITY
30

To mean that at most 30 attendees can be signed up for the same room at
overlapping times.

I have hacked up a basic prototype just to make sure the semantics can
work reasonably well. I haven't implemented the syntax or catalog
changes yet, but the basic semantics with a hard-coded cardinality seem
to hold up.

Thoughts?

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: operator exclusion constraints
Next
From: Itagaki Takahiro
Date:
Subject: Re: Syntax for partitioning