Re: TODO list comments

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: TODO list comments
Дата
Msg-id 8B68D09B-8824-4A6A-9732-BD776E130224@myrealbox.com
обсуждение исходный текст
Ответ на Re: TODO list comments  (Matt Miller <mattm@epx.com>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump fails to set index ownership
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Stuff running slooow