Re: Two databases on the same server, looking for idea how to restrict access.

Lists: pgsql-general
From: Condor <condor(at)stz-bg(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Two databases on the same server, looking for idea how to restrict access.
Date: 2012-06-07 14:39:41
Message-ID: f647045f03d91e01130e852c75061e4c@stz-bg.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hello,

I have two databases on postgresql in different servers, one main
database and one secondary not much important,
but the problem is they should use some tables both for reading and
writing and the secondary postgresql should not
have access to whole database on the main database. Im thinking to
combine both databases on same server and split them
with different schema also to make load balance and some kind of
permissions to restrict secondary database to read whole
database on the main database or some kind of shared tables (files).
Any one have some ideas how I can do this ? Any ideas is welcome.

Thanks,
Hristo.


From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Condor <condor(at)stz-bg(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Two databases on the same server, looking for idea how to restrict access.
Date: 2012-06-07 17:07:55
Message-ID: 4FD0DFEB.70503@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 07/06/2012 15:39, Condor wrote:
> Hello,
>
> I have two databases on postgresql in different servers, one main
> database and one secondary not much important,
> but the problem is they should use some tables both for reading and
> writing and the secondary postgresql should not
> have access to whole database on the main database. Im thinking to
> combine both databases on same server and split them
> with different schema also to make load balance and some kind of
> permissions to restrict secondary database to read whole
> database on the main database or some kind of shared tables (files). Any
> one have some ideas how I can do this ? Any ideas is welcome.

Your idea of two schemas in the one database is the way to go - you
cannot share tables between different databases.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie


From: Darren Duncan <darren(at)darrenduncan(dot)net>
To: rod(at)iol(dot)ie
Cc: Condor <condor(at)stz-bg(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Two databases on the same server, looking for idea how to restrict access.
Date: 2012-06-08 04:03:26
Message-ID: 4FD1798E.3000205@darrenduncan.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Raymond O'Donnell wrote:
> On 07/06/2012 15:39, Condor wrote:
>> I have two databases on postgresql in different servers, one main
>> database and one secondary not much important,
>> but the problem is they should use some tables both for reading and
>> writing and the secondary postgresql should not
>> have access to whole database on the main database. Im thinking to
>> combine both databases on same server and split them
>> with different schema also to make load balance and some kind of
>> permissions to restrict secondary database to read whole
>> database on the main database or some kind of shared tables (files). Any
>> one have some ideas how I can do this ? Any ideas is welcome.
>
> Your idea of two schemas in the one database is the way to go - you
> cannot share tables between different databases.

Further to this point, make sure you have a different database user for each of
the people or applications you want to service, give the two schemas different
owners or do appropriate privilege granting in the database, to keep each
person/application to just the things they should see and nothing else. --
Darren Duncan


From: René Romero Benavides <ichbinrene(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Two databases on the same server, looking for idea how to restrict access.
Date: 2012-06-08 16:55:15
Message-ID: 4FD22E73.50406@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Am 07.06.2012 23:03, schrieb Darren Duncan:
> Raymond O'Donnell wrote:
>> On 07/06/2012 15:39, Condor wrote:
>>> I have two databases on postgresql in different servers, one main
>>> database and one secondary not much important,
>>> but the problem is they should use some tables both for reading and
>>> writing and the secondary postgresql should not
>>> have access to whole database on the main database. Im thinking to
>>> combine both databases on same server and split them
>>> with different schema also to make load balance and some kind of
>>> permissions to restrict secondary database to read whole
>>> database on the main database or some kind of shared tables (files).
>>> Any
>>> one have some ideas how I can do this ? Any ideas is welcome.
>>
>> Your idea of two schemas in the one database is the way to go - you
>> cannot share tables between different databases.
>
> Further to this point, make sure you have a different database user
> for each of the people or applications you want to service, give the
> two schemas different owners or do appropriate privilege granting in
> the database, to keep each person/application to just the things they
> should see and nothing else. -- Darren Duncan
>
For that sort of thing you might use dblink as well, but the separate
schemas idea is way simpler and effective.
http://www.postgresql.org/docs/current/static/dblink.html
--
pglearn.blogspot.mx:postgresql recipes <http://pglearn.blogspot.mx/>
*Twitter*.You might consider to follow *(at)sqlhotfix*