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 Wed, 12 Jul 2006 15:15:47 GMT
Mamta Satoor wrote:
> Hi,
> 
> I spent some time prototyping revoke privilege for foreign key constraint
> based on my proposal earlier in this thread.
> I added following code to ConstraintDescriptor.makeInvalid
> 
>  if (action == DependencyManager.REVOKE_PRIVILEGE)
>  {
>   PreparedStatement ps = lcc.prepareInternalStatement("alter table "+
> table.getQualifiedName() + " drop constraint " + constraintName);
> 
>   ResultSet rs = ps.execute(lcc, true, 0L);
>   rs.close();
>   rs.finish();
>   return;
> 
>  }
> 
> This works fine as long as the user who issued the revoke references
> privilege is a dba or owner of the table on which foreign key constraint is
> defined. But for any other user, the revoke references privilege barfs
> saying that user can't perform the operation in that schema.

I would have exepected the ConstraintDescriptor to drop itself directly
using the DataDictionary apis, rather than go back through SQL. Would
that be possible?

Dan.



Mime
View raw message