Re: [GENERAL] Constraining overlapping date ranges

2010-12-25 Thread Filip Rembiałkowski
tart_date, end_date) > WITH &&) > > -Original Message----- > From: Filip Rembiałkowski [mailto:filip.rembialkow...@gmail.com] > Sent: Wednesday, December 22, 2010 8:28 AM > To: McGehee, Robert > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Constr

Re: [GENERAL] Constraining overlapping date ranges

2010-12-22 Thread McGehee, Robert
our suggestion: ... EXCLUDE USING gist (f_point(id) WITH ~=, f_period(start_date, end_date) WITH &&) -Original Message- From: Filip Rembiałkowski [mailto:filip.rembialkow...@gmail.com] Sent: Wednesday, December 22, 2010 8:28 AM To: McGehee, Robert Cc: pgsql-general@postgresql.org Subject

Re: [GENERAL] Constraining overlapping date ranges

2010-12-22 Thread Filip Rembiałkowski
2010/12/22 Thomas Kellerer : > I'm curious why you use this syntax as you have fixed values and could use > the "standard" VALUES construct without problems: > > INSERT INTO tbl VALUES (1, '2010-01-01', '2010-12-31'); no particular reason; just two keystrokes less :-) The SQL code is postgres-sp

Re: [GENERAL] Constraining overlapping date ranges

2010-12-22 Thread Thomas Kellerer
Filip Rembiałkowski, 22.12.2010 14:28: INSERT INTO tbl SELECT 1, '2010-01-01', '2010-12-31'; INSERT 0 1 I'm curious why you use this syntax as you have fixed values and could use the "standard" VALUES construct without problems: INSERT INTO tbl VALUES (1, '2010-01-01', '2010-12-31'); Regards

Re: [GENERAL] Constraining overlapping date ranges

2010-12-22 Thread Filip Rembiałkowski
2010/12/21 McGehee, Robert : > PostgreSQLers, > I'm hoping for some help creating a constraint/key on a table such that there > are no overlapping ranges of dates for any id. > > Specifically: Using PostgreSQL 9.0.1, I'm creating a name-value pair table as > such this: > > CREATE TABLE tbl (id IN

Re: [GENERAL] Constraining overlapping date ranges

2010-12-22 Thread Vincent Veyron
Le mardi 21 décembre 2010 à 10:49 -0500, McGehee, Robert a écrit : > PostgreSQLers, > I'm hoping for some help creating a constraint/key on a table such that there > are no overlapping ranges of dates for any id. > > Specifically: Using PostgreSQL 9.0.1, I'm creating a name-value pair table as

Re: [GENERAL] Constraining overlapping date ranges

2010-12-22 Thread Vincent Veyron
Le mardi 21 décembre 2010 à 10:49 -0500, McGehee, Robert a écrit : > PostgreSQLers, > I'm hoping for some help creating a constraint/key on a table such that there > are no overlapping ranges of dates for any id. > > Specifically: Using PostgreSQL 9.0.1, I'm creating a name-value pair table as

Re: [GENERAL] Constraining overlapping date ranges

2010-12-21 Thread Richard Broersma
On Tue, Dec 21, 2010 at 7:49 AM, McGehee, Robert wrote: > PostgreSQLers, > I'm hoping for some help creating a constraint/key on a table such that there > are no overlapping ranges of dates for any id. There is something you can try, but it is not exactly what you want since it is based on time

[GENERAL] Constraining overlapping date ranges

2010-12-21 Thread McGehee, Robert
PostgreSQLers, I'm hoping for some help creating a constraint/key on a table such that there are no overlapping ranges of dates for any id. Specifically: Using PostgreSQL 9.0.1, I'm creating a name-value pair table as such this: CREATE TABLE tbl (id INTEGER, start_date DATE, stop_date DATE, va