can this be done with a check expression? - Mailing list pgsql-sql

From Wayne Cuddy
Subject can this be done with a check expression?
Date
Msg-id 20120802231043.GA16173@slacker.ja10629.home
Whole thread Raw
Responses Re: can this be done with a check expression?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: can this be done with a check expression?  ("Jonathan S. Katz" <jonathan.katz@excoventures.com>)
List pgsql-sql
I have a table with 3 columns:

name text
start_id integer
end_id integer

start_id and end_id are ranges which must not overlap but can have gaps
between them. Is it possible to formulate a table check constraint that
can verify that either id does not fall within an existing range at
insert time? IE prevent overlaps during insert?

Thanks,
Wayne


pgsql-sql by date:

Previous
From: Samuel Gendler
Date:
Subject: query structure for selecting row by tags
Next
From: Tom Lane
Date:
Subject: Re: can this be done with a check expression?