Re: Search Path vs Synonyms - Mailing list pgsql-general

From Albe Laurenz
Subject Re: Search Path vs Synonyms
Date
Msg-id D960CB61B694CF459DCFB4B0128514C203937E5F@exadv11.host.magwien.gv.at
Whole thread Raw
In response to Search Path vs Synonyms  (Matthew Seaborn <Matthew.Seaborn@performgroup.com>)
Responses Re: Search Path vs Synonyms
List pgsql-general
Matthew Seaborn wrote:
> Given the situation where a user connecting to the database
> needs access to two separate schemas: the primary schema
> which contains the data they will be updating and a second
> schema which contains read-only reference data, used by many
> users, that will be using in joins on queries.
>
> I don't want to have to use fully qualified names (I am
> migrating code from Oracle which uses synonyms), so what is
> the best way (in both performance and reliability) to refer
> to the tables;  Search Path or Synonyms?

There are no synonyms in PostgreSQL: synonyms are Oracle's way
of search_path (though more selective).

You excluded the best solution, namely to qualify the objects.

If your user should be able to access *all* tables in both
schemas unqualified and there are no name collisions between
objects in the schemas, I would recommend search_path.

Otherwise, use views.

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Alexandr Varlamov
Date:
Subject: service stopping and pg_standby on windows
Next
From: "Albe Laurenz"
Date:
Subject: Re: ECPG Deallocate PREPARE statement - bug ?