X-Original-To: pgsql-admin@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 48FD29257BE for ; Mon, 26 May 2003 22:49:38 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 76018-02 for ; Mon, 26 May 2003 22:49:33 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by developer.postgresql.org (Postfix) with ESMTP id CF693925670 for ; Mon, 26 May 2003 22:49:33 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 80003D61A; Mon, 26 May 2003 19:49:33 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 6B7115C0D; Mon, 26 May 2003 19:49:33 -0700 (PDT) Date: Mon, 26 May 2003 19:49:33 -0700 (PDT) From: Stephan Szabo To: Matt Perry Cc: Subject: Re: Restricting database access to certain users In-Reply-To: Message-ID: <20030526194806.F86210-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/367 X-Sequence-Number: 8929 On Mon, 26 May 2003, Matt Perry wrote: > I'm looking into migrating several users from MySQL to Postgres and I'm > running into a problem with security. I don't think I understand how > security is handled within postgres. I'm using PostgreSQL v7.1.3 on a Red > Hat 7.2 system. > > The problem is that there appears to not be a way to prevent users from > accessing each other's databases and creating new objects in them. As a > test, I created userB and userB and then created databaseA and databaseB. > I then connected to databasea as usera and created a table with one row of > data. I did the same with databaseb and userb. > > Next, I connected to databasea as userb and created a table. Sure enough, > postgres allowed me to create the table in databasea as userb. Only userb > could access this table. > > I wish to prevent such a situation. There doesn't seem to be a way to do > so. I can grant and revoke permissions on tables but not on databases as > a whole. In 7.3 you can pretty much do what you want. You may want to look into upgrading.