0

In Postgresql how would I create a user that can do everything expect create roles, drop databases, drop roles, drop tables but it can create a database.

Essentially this user will be used to access a database for an application that stores, updates and retrieves data and the user can create a database.

icedwater
  • 4,701
  • 3
  • 35
  • 50
dutchlab
  • 541
  • 1
  • 13
  • 27
  • When you say "create a database", I assume you also mean "create tables and schemas within that database, create indexes on the tables, etc" ? – Craig Ringer Apr 06 '14 at 04:53
  • Your question is very ambiguous and gives the impression that you are confused on database concepts and terms. Can you please rephrase in application terms what this user needs to do? – Patrick Apr 06 '14 at 04:56
  • I have an instance of Postgresql. In that instance are multiple databases. I want to have a user that is not a super user but can select, insert, update, delete in all the tables in all the databases including any new databases that may get created. I would like the user to be able to create a database but not drop it. I also do not want the user to be able create a role. Sorry for any confusion. I am new to Postgresql and in MySQL you can use check boxes in phpmyadmin to select the privileges you want and then select the databases. In phppgadmin privileges are not individually selectable. – dutchlab Apr 07 '14 at 13:29

1 Answers1

0

You create a user and make that user the owner of the database:

The following has to be done as a superuser:

create user arthur password 'verysecret';
create database arthur_db owner = arthur;

Now arthur can do anything in that database.