GotoDBA Database Development,Did You Know Did You Know #23 – Name Uniqueness

Did You Know #23 – Name Uniqueness

Every day you can learn something new, even after 20 years in the field. For some reason, I was always under the impression that within a single schema, objects must have a unique name. Apparently, this is not the case.

I just saw a case where a table and an index have the same name and I thought it should be impossible. So I checked and I found out that in Oracle, only certain objects can’t have the same name. You cannot have a table and a view with the same name (which makes sense), but there is no problem with having a table, index and a trigger, all with the same name.
This is described here (takes from Oracle 11.1 documentation): https://docs.oracle.com/cd/B28359_01/server.111/b28286/sql_elements008.htm#SQLRF00223

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post