db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satheesh Bandaram <sathe...@Sourcery.Org>
Subject Re: [PATCH] Synonym support in Derby.
Date Thu, 02 Jun 2005 01:06:12 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
I did consider putting SYNONYM info into SYSTABLES with synonym target
being present in SYSALIASES. That would have been a clean
implementation. But, alias, I need to store schemaName of the target as
a name, instead of as ID. Unless I overload 'javaClassName' column for
schema name, it wouldn't be possible. So, no, I am not doing that
already.<span class="moz-smiley-s3"><span> ;-)&nbsp; </span></span>I
you might come up with a cleverer way to do this, that is why I posted
the question first.<br>
Well, I currently check if a table of same name is present before
allowing a synonym to be created. Same the other way. Not good? <span
 class="moz-smiley-s7"><span> :-\&nbsp; </span></span><br>
Daniel John Debrunner wrote:<br>
<blockquote cite="mid429E56F9.40105@debrunners.com" type="cite">
  <pre wrap="">Satheesh Bandaram wrote:

  <blockquote type="cite">
    <pre wrap="">I almost submitted a patch using option 1, like I said I would. I have
added a SynonymAliasInfo to hold target of a synonym, which is
schemaName.tableName. I think this schemaName needs to be stored as a
name, instead of an ID so that the synonym stays valid even after
droping and recreating the target schema.
  <pre wrap=""><!---->
That seems like correct behaviour.

  <blockquote type="cite">
    <pre wrap="">Yes, the namespace for SYNONYM is the same for tables and views. You
can't create a synonym if a table of that name already exists.
  <pre wrap=""><!---->
An explanation of how this is enforced would be good, another approach
would be to introduce a new table type in SYSTABLES, and then the
uniqueness would be handled by the existing code. Maybe you are doing
that already. I guess I should wait for the patch. :-)



View raw message