33

I am unable to create databases using my postgres client with the user I log in as.

I am having trouble figuring out how increase the privileges of my user. I have access to the linux server running postgres and am able to use psql to log on as my user and as the postgres user.

Can someone tell me what commands I should run to allow my user to create databases on my server through the postgres GUI running on a remote host?

Many thanks,

van
  • 8,079
  • 19
  • 57
  • 88

1 Answers1

67

I don´t know of a postgres GUI, but here's how to do it in the psql-console (logged in as the superuser):

=> ALTER USER your_username CREATEDB;

See http://www.postgresql.org/docs/current/interactive/sql-alteruser.html for more info.

Philip Couling
  • 10,963
  • 4
  • 37
  • 63
bos
  • 6,020
  • 3
  • 25
  • 44
  • 1
    You should be able to run this from a SQL window running in the GUI. You will need to be logged in as a super user: `postgres` is a super user by default. – Philip Couling Jan 24 '12 at 17:19
  • Not working for me. I got `ERROR: permission denied` after I ran `ALTER USER kbocnezkkamhnt CREATEDB;` in the PostgreSQL shell (with sudo). – Paul Dec 07 '19 at 22:38
  • @Paul: sudo does not affect Postgres-credentials. You are most likely trying to run the command as a normal user. – bos Dec 10 '19 at 13:59
  • @bos I don't know how I can run it successfully. I've tried to run `GRANT ALL PRIVILEGES ON DATABASE TO ;` and some other commands, but without success. – Paul Dec 10 '19 at 21:37