From: Paul Lambert <paul.lambert@reynolds.com.au>
To: pgsql admin <pgsql-admin@postgresql.org>
Subject: Schema security
Date: Thu, 13 Dec 2007 10:52:31 +0900
Message-ID: <4760905F.2020406@reynolds.com.au> (raw)
I have a schema for example called f65, and the public schema of course,
in a database.
I've created a user f65 to access only the f65 schema using the following:
CREATE ROLE f65 LOGIN
ENCRYPTED PASSWORD 'md52a630d68054defeed4b4c27cb6413ece'
NOSUPERUSER NOINHERIT NOCREATEDB NOCREATEROLE;
REVOKE ALL ON SCHEMA public FROM public;
REVOKE ALL ON SCHEMA f65 FROM public;
GRANT ALL ON SCHEMA f65 TO f65;
Which gives the f65 user access to the schema, but they cannot access
any of the objects within it (i.e. permission denied when trying a
select from a table)
testdb=> select * from f65.billing;
ERROR: permission denied for relation billing
I would have thought giving the user all privileges on a schema would by
default add them to all objects within it, but clearly not. Do I need to
explicitly go through every object within the schema and grant that user
access to them or is there an easier way of doing it? Something like a
"GRANT CASCADE" option?
Cheers,
P.
--
Paul Lambert
Database Administrator
AutoLedgers
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: paul.lambert@reynolds.com.au
Subject: Re: Schema security
In-Reply-To: <4760905F.2020406@reynolds.com.au>
* 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