Re: RES: Creating a new type - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: RES: Creating a new type
Date
Msg-id 20097.1151588820@sss.pgh.pa.us
Whole thread Raw
In response to RES: Creating a new type  ("Rodrigo Sakai" <rodrigo.sakai@zanthus.com.br>)
Responses RES: RES: Creating a new type
List pgsql-interfaces
"Rodrigo Sakai" <rodrigo.sakai@zanthus.com.br> writes:
>   So, I have to guarantee that this situation doesn't occur! But I don't
> want to use triggers because this check must be done on almost all tables
> that uses the type:

The fact that you don't want to do it doesn't make it the wrong
solution ;-)

At the moment there is no other way than a trigger.  There's been some
speculation about whether GIST indexes could be extended to enforce
conditions like "no overlapping values in this column" (as a
generalization of the concept of unique indexes).  No one's tried to
make that happen, though.

BTW, you might want to look at the "timetravel" code in contrib/spi/
... it's a tad old and crufty, but it sounds like you are trying to do
something pretty similar to that.
        regards, tom lane


pgsql-interfaces by date:

Previous
From: "Rodrigo Sakai"
Date:
Subject: RES: Creating a new type
Next
From: "Rodrigo Sakai"
Date:
Subject: RES: RES: Creating a new type