Re: Connection to second database on server - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Connection to second database on server
Date
Msg-id dcc563d10808242059v1cd8b94el39e7f75888ae49c8@mail.gmail.com
Whole thread Raw
In response to Re: Connection to second database on server  (Troy Rasiah <troyr@vicnet.net.au>)
Responses Re: Connection to second database on server
List pgsql-general
On Sun, Aug 24, 2008 at 8:43 PM, Troy Rasiah <troyr@vicnet.net.au> wrote:
>
> Sorry for bringing up an old post...If you have a generic set of tables..
>
> eg. table of countries / post codes etc which are used across several
> databases what is the best way to access / store them?
> I currently
>  - use dblink to create views when i want to do joins,
>  OR
>  - i just open up a separate db handle when i just want to display the
> data (via a perl script) from the 'generic database' (eg. a select list
> of countries)
>
> but was wondering whether schema's would apply to me as well ?

Yes, schemas would be much better.  The nice thing is with
search_path, you could have a setup where application1 and
application2 live in different schemas but have access to a common
schema.  When running app1, you'd do something like:

set search_path='app1','commonschema';

and when running app2 you'd change the app1 up there to app2 and then
you could access the tables in both schemas without having to use
prefixes.

pgsql-general by date:

Previous
From: Troy Rasiah
Date:
Subject: Re: Connection to second database on server
Next
From: Troy Rasiah
Date:
Subject: Re: Connection to second database on server