Re: [GENERAL] unique index on variable time

2006-04-16 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > On Sun, Apr 16, 2006 at 07:07:11PM +0300, [EMAIL PROTECTED] wrote: >> I am interested to know if I can define an unique index on a timestamp >> column to reject values within one hour. Perhaps CREATE UNIQUE INDEX foo ON tab (date_trunc('hour', co

Re: [GENERAL] unique index on variable time

2006-04-16 Thread Michael Fuhr
On Sun, Apr 16, 2006 at 07:07:11PM +0300, [EMAIL PROTECTED] wrote: > I am interested to know if I can define an unique index on a timestamp > column to reject values within one hour. Last month I posted an idea for enforcing unique constraints on date ranges by using a composite type and a custom

[GENERAL] unique index on variable time

2006-04-16 Thread [EMAIL PROTECTED]
hello, I am interested to know if I can define an unique index on a timestamp column to reject values within one hour. insert into table(timestamp_col) values(LOCALTIMESTAMP); insert into table(timestamp_col) values(LOCALTIMESTAMP + '5 minutes'::INTERVAL); I want the second insert to fail w