How to grant a user account permission for postgres create db and user?

276    Asked by Amitraj in SQL Server , Asked on Oct 4, 2022

How do I give a user account in PostgreSQL the ability to create and drop databases? Is there a way to do this with GRANT?

Answered by Amit jaisawal
For postgres create db and user -

It's done with ALTER USER username CREATEDB;
See ALTER USER in the doc.

To drop a database, either you're a superuser (which can be granted with ALTER USER too) or you must own the database.



Your Answer

Interviews

Parent Categories