I have completed the open issues (that I'm aware of) for operator
exclusion constraints:

http://archives.postgresql.org/message-id/1257101600.27737.159.ca...@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


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to