db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: Revoke REFERENCES privilege and drop foreign key constraint
Date Thu, 13 Jul 2006 15:01:35 GMT
Bryan Pendleton wrote:
> [ Possible re-send of this message; I've been having email problems,
> sorry. ]
>>         I looked through alter table constant action to see what happens
>>         when a user issues a drop constraint foreignkeyname and it seems
>>         like there is lot more involved then simply calling the data
>>         dictionary to drop the constraint descriptor.
> What about re-factoring this code and moving the extra code out of
> AlterTableConstantAction's drop constraint subroutine and into data
> dictionary's
> drop constraint routine.

I think that's pushing too much knowledge of the SQL system into the
DataDictionary. A constraint may share the underlying index with other
SQL indexes, thus dropping the constraint must check usage on the
underlying index etc.

> Then, we could share this code between alter table drop constraint, and
> revoke privilege.

The ConstantAction class for the drop constraint already contains the
logic, thus it could be the share point. Though as Mamta showed, we
already have a easy api to do the sharing, at the SQL level. All that is
required is a mechanism to run a SQL statement as another user, i think
this is something that will be required in the future, so seems like a
good thing to add.


View raw message