Re: table synonyms - Mailing list pgsql-general

From Jim C. Nasby
Subject Re: table synonyms
Date
Msg-id 20050523002814.GA44623@decibel.org
Whole thread Raw
In response to table synonyms  ("Jayme Jeffman Filho" <jjeffman@cpovo.net>)
List pgsql-general
On Sun, May 22, 2005 at 03:28:22PM -0300, jjeffman@cpovo.net wrote:
> Of course! Maybe I am mixing users and schemas, because in Oracle they
> are the same, the schema has the name of the user which is the owner of
> the database tables and objects.
>
> So the problem can be described as follows :
>
> 1. Let be Ent01 an enterprise, and Ent02 a different one.
> 2. At Ent01 the database schema has the name "SCH01" and at Ent02 the
> database schema has the name "FOO" .
> 3. The same application must run in booth enterprises, and all the
> database queries and table names are the same, just the schemas has
> different names.
> 4. The application can run using a database user other then the tables
> owner, so the queries must be written using the coplete format
> (schema.table.column) .
>
> Using Oracle I can set up synonyms for the tables and by pass the format
> above, or I can use a macro substitution (ODAC components) to use the
> correct schema name, setting it at runtime.

In PostgreSQL, you can get roughly the same behavior using search_path.
http://lnk.nu/postgresql.org/2r2.html

> By the way what "FWIW" stands for ?

For What It's Worth.
--
Jim C. Nasby, Database Consultant               decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

pgsql-general by date:

Previous
From: Joe Conway
Date:
Subject: Re: Postgres 8.0.3 Fedora RPMS ?
Next
From: "Sim Zacks"
Date:
Subject: Re: double quotes inside VBA string ?