proposal: operator exclusion constraints with cardinality

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: proposal: operator exclusion constraints with cardinality
Date: 2009-11-01 23:54:57
Message-ID: 1257119697.27737.214.camel@jdavis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Itagaki Takahiro 2009-11-02 00:12:39 Re: Syntax for partitioning
Previous Message Bernard Grosperrin 2009-11-01 23:52:04 Error on compile for Windows