Hi ,tom
I am sorry that I proposed a similar question some days ago where I misstated the question. So I describe here again , correctly.
I am currently working with synonym in oracle and find the fact that:
SQL> create public synonym mysynonym for myschema.mytable;
Synonym created.
SQL> create table myschema.mysynonym(a int);
//a table who has the same name with public synonym
ERROR at line 1:
ORA-00955: name is already used by an existing object
According to the doc of oracle described here, it is quite reasonable:
https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_7001.htm yeah, it is quite reasonable, expected. but I find that 'vice versa' does not hold here:
SQL> create table myschema.mysynonym(a int);
Table created. //create a table whose name is "mysynonym" firstly
SQL> create public synonym mysynonym for myschema.mytable;
Synonym created.
// and then create a public synonym with the same name of the table.
// wow, succeed. IMHO, it should have been failed.
would you please help me figure out why ?
thanks a lot.
Sorry, I can't reproduce your error
SQL> create public synonym mysynonym for mcdonac.mytable;
Synonym created.
SQL> create table mcdonac.mysynonym(a int);
Table created.