Re: Database/Table Owner Question

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <Michael(dot)L(dot)Blume(at)frb(dot)gov>,<pgsql-bugs(at)postgresql(dot)org>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Database/Table Owner Question
Date: 2009-02-26 21:56:46
Message-ID: 49A6BBBE.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

>>> <Michael(dot)L(dot)Blume(at)frb(dot)gov> wrote:
> We have a lot of test databases with multiple db_owners, but very few

> superusers, and table_owners switch all the time.

A quick, untested idea:

Create a table_owner role.

Create your users with NOINHERIT and GRANT table_owner to them as
appropriate.

REVOKE CREATE ON SCHEMA public FROM public.

GRANT CREATE ON SCHEMA PUBLIC TO table_owner.

A user would need to SET ROLE table_owner to create a table.
RESET ROLE would put them back to normal.

Just a thought....

-Kevin

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Josh Berkus 2009-02-26 23:25:27 Weird quirk with pg_dump of complex types
Previous Message Michael.L.Blume 2009-02-26 21:28:07 Database/Table Owner Question

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2009-02-26 22:35:54 Re: Connection refused (0x0000274D/10061).
Previous Message Torsten Bronger 2009-02-26 21:51:32 Re: Getting time-dependent load statistics