Thread: Same Table Name - 2 Owners

Same Table Name - 2 Owners

From
Sam Stearns
Date:
Howdy,

In Oracle, I have a table name that is the same name between 2 different owners but completely different DDL:


SQL> select owner, object_name, object_type from dba_objects where object_name = 'SUBSCRIPTIONS' and object_type = 'TABLE';

OWNER      OBJECT_NAME          OBJECT_TYPE
---------- -------------------- -----------------------
INTERFACE  SUBSCRIPTIONS        TABLE
ORACLE     SUBSCRIPTIONS        TABLE

SQL>


Is it possible to do this in Postgres?

--

Samuel Stearns
Lead Database Administrator
c: 971 762 6879 | o: 503 672 5115 | DAT.com

DAT

Re: Same Table Name - 2 Owners

From
"David G. Johnston"
Date:
On Friday, October 4, 2024, Sam Stearns <sam.stearns@dat.com> wrote:
Is it possible to do this in Postgres?

Within PostgreSQL, two objects can have the same name if they are of different types (note, relations is a fairly broad type category) or they exist in different schemas.

David J.

Re: Same Table Name - 2 Owners

From
Tom Lane
Date:
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Friday, October 4, 2024, Sam Stearns <sam.stearns@dat.com> wrote:
>> Is it possible to do this in Postgres?

> Within PostgreSQL, two objects can have the same name if they are of
> different types (note, relations is a fairly broad type category) or they
> exist in different schemas.

The Oracle case probably also works by putting the tables in different
schemas.  I recall hearing that Oracle identifies "owner" with
"schema" much more closely than we do.

            regards, tom lane



Re: Same Table Name - 2 Owners

From
Guillaume Lelarge
Date:
Hello,

Le sam. 5 oct. 2024 à 00:22, Tom Lane <tgl@sss.pgh.pa.us> a écrit :
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Friday, October 4, 2024, Sam Stearns <sam.stearns@dat.com> wrote:
>> Is it possible to do this in Postgres?

> Within PostgreSQL, two objects can have the same name if they are of
> different types (note, relations is a fairly broad type category) or they
> exist in different schemas.

The Oracle case probably also works by putting the tables in different
schemas.  I recall hearing that Oracle identifies "owner" with
"schema" much more closely than we do.


+1


Regards.


--
Guillaume.

Re: Same Table Name - 2 Owners

From
Sam Stearns
Date:
Thank you all for the help!  We're testing this out now with some Oracle imports into Postgres.

Sam

On Sat, Oct 5, 2024 at 12:07 AM Guillaume Lelarge <guillaume@lelarge.info> wrote:
Hello,

Le sam. 5 oct. 2024 à 00:22, Tom Lane <tgl@sss.pgh.pa.us> a écrit :
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Friday, October 4, 2024, Sam Stearns <sam.stearns@dat.com> wrote:
>> Is it possible to do this in Postgres?

> Within PostgreSQL, two objects can have the same name if they are of
> different types (note, relations is a fairly broad type category) or they
> exist in different schemas.

The Oracle case probably also works by putting the tables in different
schemas.  I recall hearing that Oracle identifies "owner" with
"schema" much more closely than we do.


+1


Regards.


--
Guillaume.


--

Samuel Stearns
Lead Database Administrator
c: 971 762 6879 | o: 503 672 5115 | DAT.com

DAT