Thread: Same Table Name - 2 Owners
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>
OWNER OBJECT_NAME OBJECT_TYPE
---------- -------------------- -----------------------
INTERFACE SUBSCRIPTIONS TABLE
ORACLE SUBSCRIPTIONS TABLE
SQL>
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.
"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
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
Great article on this topic: https://stormatics.tech/blogs/transitioning-from-oracle-to-postgresql-understanding-the-concept-of-schema
Regards.
--
Guillaume.
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.+1Great article on this topic: https://stormatics.tech/blogs/transitioning-from-oracle-to-postgresql-understanding-the-concept-of-schemaRegards.
--Guillaume.