Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgres user create database

Tags:

postgresql

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,

like image 575
van Avatar asked Jan 24 '12 14:01

van


People also ask

What is a PostgreSQL user?

The user is created by postgresql on which one of your programs depend. Its no problem that you have an extra user on your machine, in fact you'll have several such users for various purposes on your computer. These users generally dont have a password because usually no one interactively logs into the user account.

Which command creates a database in PostgreSQL?

createdb creates a new PostgreSQL database. Normally, the database user who executes this command becomes the owner of the new database. However, a different owner can be specified via the -O option, if the executing user has appropriate privileges. createdb is a wrapper around the SQL command CREATE DATABASE .


1 Answers

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.

like image 189
bos Avatar answered Sep 20 '22 23:09

bos