Re: dropdb ; createdb equivalent without createdb permission? - Mailing list pgsql-general

From Steve Crawford
Subject Re: dropdb ; createdb equivalent without createdb permission?
Date
Msg-id 469280D5.5040802@pinpointresearch.com
Whole thread Raw
In response to dropdb ; createdb equivalent without createdb permission?  ("Tim Olsen" <tolsen718@gmail.com>)
List pgsql-general
Tim Olsen wrote:
> Hello,
>
> I would like to be able to grant a user the ability to completely
> reset a database for testing purposes.  If possible, I would like the
> user to be able to do a "dropdb" followed by a "createdb", but without
> allowing this user to create any database.  In other words, I would
> like the user to be granted createdb permission for only a particular
> database.  I don't believe this is possible in postgresql.  Is there a
> dropdb-followed-by-createdb equivalent the user could use?

As an alternative, how about a separate database cluster. A user can run
their own copy of PostgreSQL - just initdb but set the directory to
someplace that user has appropriate access privilege. This might require
use of a different port if PostgreSQL is already running on that machine
but then your user is free to create, change, test and destroy as they
see fit.

Or I suppose you could drop...cascade all the user tables, views, etc.
in the database and then do a vacuum full.

Cheers,
Steve

pgsql-general by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: dropdb ; createdb equivalent without createdb permission?
Next
From: "Tim Olsen"
Date:
Subject: Re: dropdb ; createdb equivalent without createdb permission?