Subject Re: [Firebird-Architect] rfc: TRUNCATE TABLE
Author Adriano dos Santos Fernandes
Agree with Dmitry opinion.

Vlad, when you say "allow to TRUNCATE table only for SYSDBA and OWNER",
OWNER means both DB owner or TABLE owner?


Adriano


Dmitry Yemanov 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.
>>
>
> Sounds okay to me.
>
>
>> e) it will be good to implement TRUNCATE privilege to satisfy Access rules but for the first time
>> we can allow to TRUNCATE table only for SYSDBA and OWNER.
>>
>
> Agreed.
>
>
>> The main concern is about rollback's (or undo). If we will perform TRUNCATE TABLE as usual
>> DML statement
>>
>
> I believe we should treat TRUNCATE TABLE similarly to DDL statements.
>
>
>> Another approach is to require exclusive lock on table when TRUNCATE is issued (to prevent
>> any concurrent access to table's data) and to defer TRUNCATE execution to the commit time. It
>> allows us to not preserve table contents for the indefinite time and to avoid complex manipulations
>> with undo-log.
>>
>
> This is a way to go, IMO.
>
>
> Dmitry
>