What yould be the sql statement (that the user postgres will execute) so it will be impossible for the postgres user user1 to delete (drop) databases?
Or can I add a rule into some config file?
|
What yould be the sql statement (that the user postgres will execute) so it will be impossible for the postgres user Or can I add a rule into some config file? |
|||
|
In PostgreSQL, only the owner of a database can drop a database. (Superusers can drop databases, but that's a different issue.) So changing the owner is the most direct way to prevent user1 from dropping any databases. Fix that with ALTER DATABASE.
To give specific permissions back to user1, use GRANT. You're probably looking for something like
But read the documentation for GRANT first. You might need WITH GRANT OPTION, permissions on sequences, something less than ALL PRIVILEGES, and so on. |
|||||||||
|
user1own the database? – a_horse_with_no_name Jan 4 '12 at 14:48user1owns, but I'd also behappy to have at least the other option. – mit Jan 4 '12 at 15:13postgresthe owner of the database. – a_horse_with_no_name Jan 4 '12 at 15:32