Re: Same Table Name - 2 Owners

From: Holger Jakobs <holger(at)jakobs(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Same Table Name - 2 Owners
Date: 2024-10-04 22:21:27
Message-ID: caf17507-f447-2b52-1b88-5bcdcfd8621a@jakobs.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Am 05.10.24 um 00:09 schrieb Sam Stearns:
> 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
> <https://www.dat.com/?utm_medium=email&utm_source=DAT_email_signature_link>
In Oracle, owner is synonomous with a schema, they are coupled 1:1. So
don't be fooled, the two tables are in two different schemas.

If you want to do this in PostgreSQL, just create two schemas and put
two tables with the same name (but different properties) into each of
them, respectively.

In PostgreSQL, users (actually login roles) and schemas aren't tied to
each other. You are free to name them as you wish.

Regards,
Holger

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2024-10-04 22:22:28 Re: Same Table Name - 2 Owners
Previous Message David G. Johnston 2024-10-04 22:17:03 Re: Same Table Name - 2 Owners