Subject Re: [Firebird-Architect] rfc: TRUNCATE TABLE
Author Adriano dos Santos Fernandes
Jim Starkey wrote:
> Adriano dos Santos Fernandes wrote:
>
>> Vlad Khorsun wrote:
>>
>>
>>> c) Syntax rule 3 means truncated table must not participate in FOREIGN KEY constraints as
>>> master table.
>>> ORACLE relaxed this rule and allow self-referenced constraints. I think we can follow it.
>>>
>>>
>>>
>> Can't we also allow it when all detail tables are being truncated on the
>> same transaction?
>>
>>
>>
>>
>
> There are serious problems making TRUNCATE transactional. For example,
> what happens when a transaction does TRUNCATE then an insert into the
> table, then rolls back. It can be handled -- anything can with enough
> effort, resource, and time -- but is it feasible? Database systems
> built around logs can be made to handle this, but Firebird doesn't have
> a log.
I didn't want transactional truncate. In fact, I manifested in favor of
DDL (non transactional).

So my proposal of allow truncate on tables that is master part of
foreign key constraints is to take advantage on how FB deferred work works.


Adriano