Search Postgresql Archives

Re: Do we want SYNONYMS?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





2010/12/7 Michael C Rosenstein <mcr@xxxxxxxxx>
On 12/6/10 4:09 PM, Tom Lane wrote:
Michael C Rosenstein<mcr@xxxxxxxxx> Â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@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
// Dmitriy.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux