One year ago, I wrote about a side effect of deferred segment creation and drop tablespace :
on deferred segment creation
Today I discoved one more side effect :
In the good old days (I read once that you are old as soon as you start talking about the good old days) and according to the doc :
You cannot truncate the parent table of an enabled foreign key constraint. You must disable the constraint before truncating the table
SQL> alter session set deferred_segment_creation=false;
Session altered.
SQL> create table t1(x number primary key);
Table created.
SQL> create table t2(x number references t1);
Table created.
SQL> truncate table t1;
truncate table t1
*
ERROR at line 1:
ORA-02266: unique/primary keys in table referenced by enabled foreign keys
This however does not apply if you have deferred segment creation and empty tables
SQL> alter session set deferred_segment_creation=true;
Session altered.
SQL> create table t1(x number primary key);
Table created.
SQL> create table t2(x number references t1);
Table created.
SQL> truncate table t1;
Table truncated.
Table truncated. Ok, what’s the point in truncating an empty table …
since the software behaves differently as documented, this is not a side effect but a bug
yes, but not one bug I am going to report as I fail to find an appropriate business case… Maybe a documentation bug ?
probably an architecture bug… difficult to change the architecture of the tab$ constraints without introducing new bugs