Re: TODO list comments - Mailing list pgsql-hackers

From Michael Glaesemann
Subject Re: TODO list comments
Date
Msg-id 8B68D09B-8824-4A6A-9732-BD776E130224@myrealbox.com
Whole thread Raw
In response to Re: TODO list comments  (Matt Miller <mattm@epx.com>)
List pgsql-hackers
On Aug 25, 2005, at 11:29 PM, Matt Miller wrote:


> On Thu, 2005-08-25 at 15:50 +0900, Michael Glaesemann wrote:
>
>
>>>> * %Remove CREATE CONSTRAINT TRIGGER
>>>>
>>>>
>>>>
>>> Do we really want to remove it,
>>>
>>>
>>
>> Also, I believe CONSTRAINT TRIGGERS are the only way to provide
>> transaction level (rather than statement level) referential
>> integrity.
>>
>>
>
> Don't deferrable foreign keys give you transaction-level referential
> integrity?  From the SET CONSTRAINTS doc:
>

Sorry, I misspoke. What I'm thinking of is not referential integrity  
in the sense of foreign keys, but assertions, which PostgreSQL does  
not yet support.

Say for example you have a table that contains time periods marked by  
a start_date and an end_date and you want there to be no gaps between  
the different time periods in the table for a given key. When doing  
updates, deletes, or inserts on this table, you'll need to check to  
make sure there are no gaps when the transaction is finished.  
However, there may indeed be gaps during the transaction as  
start_dates and end_dates are updated. Triggers can be written to  
enforce this kind of integrity, but they'll only work if they're  
deferrable.

Michael Glaesemann
grzm myrealbox com





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump fails to set index ownership
Next
From: Bruno Wolff III
Date:
Subject: Re: Stuff running slooow