Re: dropdb ; createdb equivalent without createdb permission?

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Tim Olsen <tolsen718(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: dropdb ; createdb equivalent without createdb permission?
Date: 2007-07-09 18:39:17
Message-ID: 469280D5.5040802@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tim Olsen 2007-07-09 18:42:17 Re: dropdb ; createdb equivalent without createdb permission?
Previous Message Andrew Sullivan 2007-07-09 18:29:38 Re: dropdb ; createdb equivalent without createdb permission?