You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Rick Hillegas <ri...@oracle.com> on 2014/07/29 17:06:16 UTC

renaming a referenced table

I am working on a patch (DERBY-6672) which lifts the following 
limitation in Derby: you can't RENAME a table referenced by a foreign 
key. The limitation seems to go back at least as far as Cloudscape 5.1 
but not as far back as Cloudscape 3.5 (which doesn't have a RENAME TABLE 
command). I don't have access to the code archaeology for this 
limitation. Could someone with access to the code archaeology help me 
understand the motivation for this limitation? I don't want to remove 
this limitation if it is going to cause some known edge-case to fail.

Thanks,
-Rick

Re: renaming a referenced table

Posted by Rick Hillegas <ri...@oracle.com>.
On 7/29/14 2:53 PM, Mamta Satoor wrote:
> Hi Rick,
> I looked through the original functional spec and see a mention of 
> this limitation but the reason is not explained. I unfortunately do 
> not have old emails anymore where they may have been discussions about 
> it. Talked to Mike on this briefly and his guess was that may be at 
> that time in Cloudscape's life cycle, we were more focused on getting 
> easy functionality out quick or may be there were catalogs referencing 
> things by name rather than uuid and thus making the 
> complete implementation harder.
> So, not really sure why this restriction was put in place.
> thanks,
> Mamta
>
>
> On Tue, Jul 29, 2014 at 8:06 AM, Rick Hillegas 
> <rick.hillegas@oracle.com <ma...@oracle.com>> wrote:
>
>     I am working on a patch (DERBY-6672) which lifts the following
>     limitation in Derby: you can't RENAME a table referenced by a
>     foreign key. The limitation seems to go back at least as far as
>     Cloudscape 5.1 but not as far back as Cloudscape 3.5 (which
>     doesn't have a RENAME TABLE command). I don't have access to the
>     code archaeology for this limitation. Could someone with access to
>     the code archaeology help me understand the motivation for this
>     limitation? I don't want to remove this limitation if it is going
>     to cause some known edge-case to fail.
>
>     Thanks,
>     -Rick
>
>
Thanks, Mamta. I'm inclined to lift this limitation in 10.11.1 unless 
someone objects strongly. I haven't been able to break anything yet and 
I have verified that dblook correctly recreates foreign keys which 
reference renamed tables/columns.

Thanks,
-Rick

Re: renaming a referenced table

Posted by Mamta Satoor <ms...@gmail.com>.
Hi Rick,

I looked through the original functional spec and see a mention of this
limitation but the reason is not explained. I unfortunately do not have old
emails anymore where they may have been discussions about it. Talked to
Mike on this briefly and his guess was that may be at that time in
Cloudscape's life cycle, we were more focused on getting easy functionality
out quick or may be there were catalogs referencing things by name rather
than uuid and thus making the complete implementation harder.

So, not really sure why this restriction was put in place.

thanks,
Mamta


On Tue, Jul 29, 2014 at 8:06 AM, Rick Hillegas <ri...@oracle.com>
wrote:

> I am working on a patch (DERBY-6672) which lifts the following limitation
> in Derby: you can't RENAME a table referenced by a foreign key. The
> limitation seems to go back at least as far as Cloudscape 5.1 but not as
> far back as Cloudscape 3.5 (which doesn't have a RENAME TABLE command). I
> don't have access to the code archaeology for this limitation. Could
> someone with access to the code archaeology help me understand the
> motivation for this limitation? I don't want to remove this limitation if
> it is going to cause some known edge-case to fail.
>
> Thanks,
> -Rick
>