Search Postgresql Archives

Re: Revoke "drop database" even for superusers?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Edson Richter wrote:
> I've a bunch of databases that cannot be dropped in any case.
> 
> I was wondering if it is possible to revoke "drop database" permission
for all users, in order that
> even superuser, if he wishes to drop a database, he will need first to
"grant drop database" first.
> 
> I know there is already a safety that does not allow dropping
databases in use - I just want to make
> even harder.

You cannot play it over permissions, but what about the following trick:

postgres=# CREATE DATABASE persist;
CREATE DATABASE
postgres=# UPDATE pg_database SET datistemplate=TRUE WHERE
datname='persist';
UPDATE 1
postgres=# DROP DATABASE persist;
ERROR:  cannot drop a template database

Yours,
Laurenz Albe


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux