Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TeFPl-0001JN-HQ for pgsql-admin@arkaria.postgresql.org; Fri, 30 Nov 2012 01:29:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TeFPl-0002VX-00 for pgsql-admin@arkaria.postgresql.org; Fri, 30 Nov 2012 01:29:13 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TeFPj-0002UL-AB for pgsql-admin@postgresql.org; Fri, 30 Nov 2012 01:29:11 +0000 Received: from mail-qc0-f174.google.com ([209.85.216.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TeFPh-00022N-N6 for pgsql-admin@postgresql.org; Fri, 30 Nov 2012 01:29:10 +0000 Received: by mail-qc0-f174.google.com with SMTP id o22so11122176qcr.19 for ; Thu, 29 Nov 2012 17:29:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=U4d3X5Cfsbrts9onIeVy2miT/XYZwHoWzn8gcEGbQyA=; b=xHqXabAqHGZBPaXr3CYTlVBBZM/YRmy3Gm8Vq2GR5ioiXcqum3x+qLY5ERGJBPbU4Z Cj0vY01K+aJoZoxDFoQipM0Ypt9EolHGkelsQjfYYHHHRf+dNd/dj8mYZuyIFEH/e01q j52biDQ63x12OErAIl6Hl6MMiP6oIRpTpvjetJ7RG+ywZ74kvaigUkt07OVXqQjXRpAX KI/JszZsunpD9AbA9wQqqbJsSZOY7tU04NvzGMx/y3456ylGx4Ac8kr6lB8eRSiHOcn9 i6BIZEDL0erVzXPv+OpfzmuDEmafMw0UjfG1/IpNMAtw8OK6bVOqXcNuwv5Lt39b9ItH 4Vdw== Received: by 10.229.176.5 with SMTP id bc5mr5368534qcb.124.1354238948894; Thu, 29 Nov 2012 17:29:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.49.109.195 with HTTP; Thu, 29 Nov 2012 17:28:53 -0800 (PST) In-Reply-To: References: From: =?ISO-8859-1?Q?Gabriel_Mu=F1oz?= Date: Thu, 29 Nov 2012 22:28:53 -0300 Message-ID: Subject: Re: DBA user in Postgres To: Scott Marlowe Cc: pgsql-admin Content-Type: multipart/alternative; boundary=0016369c90a37d678f04cfac53ef X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org --0016369c90a37d678f04cfac53ef Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Scott, We found a way, it was really simple the solution was not understand= ing the user management, had many misconceptions (or brought from other databas= e engines that drive). If anyone would be needed as it gets solved, I write. Thank you, Gabriel. On Wed, Nov 28, 2012 at 11:44 PM, Gabriel Mu=F1oz = wrote: > Thank you very much for the prompt response, probably a good solution. Ma= kes > me think I'm not doing something right, because Steve is my user postgres= . > I'm migrating some 50 databases that were spread over 50 servers to one c= entral > server. > Each database has 10GB on average. > Each database has an owner user (in my example is the DBA) previously in > the above scheme each user had the postgres password on each server. > So to restore the database user is the user postgres Steve and Bob need t= o > create a user that is the as postgres but only in that database. > These users (programmers) usually make changes to the database, create > schemas, tables, views, etc and need to keep doing that in your database. > So I gave them super-user permissions and access pg_hba resting=ED from i= ts > base, yet they have many extra permissions that are not desirable as such > can one delete the database that is not theirs. > > > Thank you very much, > Gabriel. > > > On Wed, Nov 28, 2012 at 6:16 PM, Scott Marlowe w= rote: > >> On Wed, Nov 28, 2012 at 11:58 AM, Gabriel Mu=F1oz >> wrote: >> > As I can give you full permission to a user in a database. For >> everything >> > you have that database and the objects to be created in the future. >> > This means you can access all the schemes, all tables, views, function= s, >> > etc. >> > If in the future you create a new view does not have to do a specific >> GRANT >> > to that user since the user is the "owner" of the database. >> > >> > Try saying the user is super-user and restrict access only to the >> database >> > from pg_hba. But being super-user can for example delete another >> database >> > that is not theirs. >> >> If the db owner is steve, and you want bob to be able to do anything >> steve can do, you can do: >> >> grant steve to bob; >> >> Does that do what you need? >> > > --0016369c90a37d678f04cfac53ef Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Scott, We = found a way, it was really = simple the solution was not understanding the user management, had many misconceptions (or brought from other database engines that drive)= .
If anyone would be needed <= span class=3D"">as it
gets = solved, I write.

Thank you,
Gabriel.


On Wed, Nov 28, 2012 at 11:44 PM, Gabriel Mu=F1oz &= lt;gabriel.mun= oz@gmail.com> wrote:
T= hank you very much for the prompt response, probably a good solution. Ma= kes me think I'm not doing something <= span>right, because Steve is my user postgres.
I'm migrating some 50 databases that were spread over 50 servers to one central server.
Each database has 10GB on aver= age.
Each database has an = owner user (in my example is t= he DBA) previously in t= he above scheme each user had the po= stgres password on each server.
So to restore the database use= r is the user postgres Steve = and Bob need to create a user<= /span> that is the as postgres= but only in that database. These users (programmers) usually make changes to the database, create schemas, tables, views, etc and need to keep doing tha= t in your database.
So I gave them super-user perm= issions and access pg_hba resting=ED
from its base, = yet they have many extra permi= ssions that are not desirable as suc= h can one delete the da= tabase that is not theirs.


Thank you very much,
Gabriel.=
<= br>
On Wed, Nov 28, 2012 at 6:16 PM, Scott Ma= rlowe <scott.marlowe@gmail.com> wrote:
On Wed, Nov 28,= 2012 at 11:58 AM, Gabriel Mu=F1oz <gabriel.munoz@gmail.com> wrote:
> As I can give you full permission to a user in a database. For everyth= ing
> you have that database and the objects to be created in the future. > This means you can access all the schemes, all tables, views, function= s,
> etc.
> If in the future you create a new view does not have to do a specific = GRANT
> to that user since the user is the "owner" of the database.<= br> >
> Try saying the user is super-user and restrict access only to the data= base
> from pg_hba. But being super-user can for example delete another datab= ase
> that is not theirs.

If the db owner is steve, and you want bob to be able to do any= thing
steve can do, you can do:

grant steve to bob;

Does that do what you need?


--0016369c90a37d678f04cfac53ef--