pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Artur P <arturp@plukwa.net>
To: pgsql-admin@postgresql.org
Subject: Re: [admin]@postgresql.org pg_database contents ... what happens
Date: Mon, 31 May 2004 13:10:42 +0200
Message-ID: <20040531111042.GA2410@plukwa.net> (raw)
In-Reply-To: <200405302245.02687.uwe@oss4u.com>
References: <011801c446ca$09b1c580$3410fea9@zoom>
	<200405302245.02687.uwe@oss4u.com>

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



view thread (3+ messages)

Message-ID: <20040531111042.GA2410@plukwa.net>
Permalink:  ../20040531111042.GA2410@plukwa.net/
Also on:    postgresql.org/message-id/20040531111042.GA2410@plukwa.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: arturp@plukwa.net
  Subject: Re: [admin]@postgresql.org pg_database contents ... what happens
  In-Reply-To: <20040531111042.GA2410@plukwa.net>
  References: <011801c446ca$09b1c580$3410fea9@zoom> <200405302245.02687.uwe@oss4u.com> <20040531111042.GA2410@plukwa.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox