Re: Do we want SYNONYMS?

From: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>
To: Michael C Rosenstein <mcr(at)mdibl(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Do we want SYNONYMS?
Date: 2010-12-06 21:33:43
Message-ID: AANLkTinb-m3u7zY-WrkT1HdAsu8zaXttJjWPsaGjbpbr@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2010/12/7 Michael C Rosenstein <mcr(at)mdibl(dot)org>

> On 12/6/10 4:09 PM, Tom Lane wrote:
>
>> Michael C Rosenstein<mcr(at)mdibl(dot)org> writes:
>>
>>> What is "schema" in this context?
>>>>
>>>
>> Oracle "schema" == Postgres "database": a collection of objects
>>> (tables, functions, triggers, views, etc) owned by a user.
>>>
>>
>> That seems like a pretty unlikely equivalence. What I'm afraid
>> you are really saying you want is cross-database synonyms (ie links
>> to objects in remote databases). Which I'm pretty sure is not what
>> JD is offering to implement, though I think it is possible to do
>> in Oracle.
>>
>
> Nope, not talking about remote database links, but merely links to
> different databases in the same process on the same host.
>
> For example webAppUser sometimes needs to access the
> public1.get_customer_name() function, the public1.order table and the
> edit.account table. After a new data load of the public2 database, the
> webAppUser would need to access the public2.get_customer_name() function,
> the public2.order table and the edit.account table. By switching the
> webAppUser's 'get_customer_name()' and 'account' synonyms, this toggling
> between accessing public1 and public2 objects is quick, easy and seamless.
> The webAppUser code need only contain:
> select get_customer_name();
> or
> select * from order;
> without needing to be conscious of whether it is selecting from public1 or
> public2.
>
There are NOTIFY/LISTEN system in PostgreSQL and you can use
appropriate function on some event (data loaded in you case), for example.

>
> Synonyms are a great feature in Oracle. The lack of synonyms in PostgreSQL
> was one of our biggest hesitations in switching. As I said, however, we
> found a hacky workaround by toggling the webAppUser's search path.
>
> /m
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

--
// Dmitriy.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-12-06 21:38:21 Re: Do we want SYNONYMS?
Previous Message Michael C Rosenstein 2010-12-06 21:30:22 Re: Do we want SYNONYMS?