Re: unique index on variable time

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "pgsql-general(at)list(dot)coretech(dot)ro" <pgsql-general(at)list(dot)coretech(dot)ro>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: unique index on variable time
Date: 2006-04-16 16:50:26
Message-ID: 20060416165025.GA33828@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Apr 16, 2006 at 07:07:11PM +0300, pgsql-general(at)list(dot)coretech(dot)ro 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 comparison
operator:

http://archives.postgresql.org/pgsql-sql/2006-03/msg00055.php

The warning about the code being only minimally tested still stands
but maybe it'll give you some ideas.

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretschmer 2006-04-16 16:54:20 Re: inet value validation
Previous Message felix-accts-pgsql 2006-04-16 16:49:32 Query runs fast or slow