X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id E5735D1B18F for ; Mon, 31 May 2004 08:07:04 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 51383-09 for ; Mon, 31 May 2004 08:07:04 -0300 (ADT) Received: from coruscant.plukwa.net (coruscant.plukwa.net [217.113.224.85]) by svr1.postgresql.org (Postfix) with ESMTP id 51418D1B1EC for ; Mon, 31 May 2004 08:06:45 -0300 (ADT) Received: from arturp by coruscant.plukwa.net with local (Exim 4.34) id 1BUkgk-0006F8-G7 for pgsql-admin@postgresql.org; Mon, 31 May 2004 13:10:53 +0200 Date: Mon, 31 May 2004 13:10:42 +0200 To: pgsql-admin@postgresql.org Message-ID: <20040531111042.GA2410@plukwa.net> References: <011801c446ca$09b1c580$3410fea9@zoom> <200405302245.02687.uwe@oss4u.com> Mime-Version: 1.0 Content-Disposition: inline In-Reply-To: <200405302245.02687.uwe@oss4u.com> User-Agent: Mutt/1.5.6i From: Artur P X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: arturp@plukwa.net Subject: Re: [admin]@postgresql.org pg_database contents ... what happens Content-Type: text/plain; charset=us-ascii X-SA-Exim-Version: 4.0 (built Sat, 24 Apr 2004 12:31:30 +0200) X-SA-Exim-Scanned: Yes (on coruscant.plukwa.net) X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/338 X-Sequence-Number: 13654 On Sun, May 30, 2004 at 10:45:02PM -0700, Uwe C. Schroeder wrote: > On Sunday 30 May 2004 09:44 pm, Paul Gimpelj wrote: > > If I connect to any database with psql I can see all the other databases in > > table pg_database under postgresql 7.2 > > > > What happens if I delete all the rows from this table. > > > Well, similar question would be "what happens if I format the harddrive and > throw the box into the bathtub" :-) I wouldn't say so - you can delete from pg_database only if you are are granted database create/drop (or you are superuser). If I understand Paul correctly, his real question was "I can see pg_database if I connect to any database, as any user - is it safe/secure?". Then, answer to this question would be: yes, as long as you are normal user, because it is one of PostgreSQL's system tables. You can select from that table, but to update/delete from that table, you need to have rights to create/drop database. Do "select * from pg_shadow" as postgresql superuser, to check users that have permission to create/drop (see http://www.postgresql.org/docs/7.4/interactive/catalog-pg-shadow.html). So, to be safe, do not grant database creation rights to users that shouldn't have them (see also "Chapter 17. Database Users and Privileges" -> "17.2. User Attributes" http://www.postgresql.org/docs/7.4/interactive/user-attributes.html) Best regards, -- --- Artur Pietruk, arturp(-=AT=-)plukwa.net