pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sam Barnett-Cormack <s.barnett-cormack@lancaster.ac.uk>
Cc: Randall Perry <rgp@systame.com>
Cc: olly@lfix.co.uk
Cc: pgsql-admin@postgresql.org
Subject: Re: How do I grant access to entire database at
Date: Mon, 26 Jul 2004 16:46:27 -0400
Message-ID: <9472.1090874787@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.58.0407262023240.1995@localhost.localdomain>
References: <BD2ACAC3.7F3D2%rgp@systame.com>
	<Pine.LNX.4.58.0407262023240.1995@localhost.localdomain>

Sam Barnett-Cormack <s.barnett-cormack@lancaster.ac.uk> writes:
> GRANT out to have a varying degree of granularity, IMO. So you can
> specify individual sequences or tables, a glob (handy for
> table+sequence), possibly an intelligent way of including anything
> requisite for a given table, a whole DB, a whole namespace, a whole
> cluster (although then you could just make the user a superuser), all of
> the members of a DB/namespace that are of a certain type (say,
> tables+sequences, or functions-only, or whatever).

All but the last are nonstarters for the simple reason that different
kinds of objects have different sets of possible GRANT rights.  Only
"GRANT ALL" could possibly be common across different object kinds, and
it doesn't seem to me that wholesale GRANT ALL would be a particularly
common thing to want to do.

It is perhaps interesting to do something like
	GRANT SELECT ON TABLE foo.* TO user;
but I'm not sure this is so useful as to be worth enshrining in the
syntax.  You could also argue that it's a potential security hole since
it'd be mighty easy to grant rights you didn't intend to on objects you
didn't realize would match the wildcard.  (And that'd be true in spades
if the effect of the command were to automatically grant the same rights
on matching objects created in the future, which is what I think some of
the people asking for this sort of thing wanted.  But I'm outright
scared of that idea.)

As long as you're not after the implicit-effects-on-future-objects
behavior, it's easy enough to write custom functions that do exactly
what you want in this line.  I'm inclined to leave it at that for the
moment.  But perhaps we could put some examples of such functions on
techdocs, or set up a pgfoundry project for them.  If your long-term
goal is to get this functionality migrated into the core server, having
a popular pgfoundry project that embodies a specific set of features
would go a long way towards convincing people that those particular
features were right and useful.  Without any pre-existing standard
to follow, it'll be hard to get consensus on "the right thing"
otherwise.

			regards, tom lane



view thread (11+ messages)  latest in thread

Message-ID: <9472.1090874787@sss.pgh.pa.us>
Permalink:  ../9472.1090874787@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9472.1090874787@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, s.barnett-cormack@lancaster.ac.uk, rgp@systame.com, olly@lfix.co.uk
  Subject: Re: How do I grant access to entire database at
  In-Reply-To: <9472.1090874787@sss.pgh.pa.us>
  References: <BD2ACAC3.7F3D2%rgp@systame.com> <Pine.LNX.4.58.0407262023240.1995@localhost.localdomain> <9472.1090874787@sss.pgh.pa.us>

* 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