Postgresql

Last modified: 
Friday, May 1st, 2015

Connect to Postgresql as Admin on OS X Server

sudo psql -U _postgres template1

Create a Database in Psql

CREATE DATABASE dbname;

Add User to Database in Psql

CREATE USER uname WITH PASSWORD 'userpassword';

Grant All Privileges to a User

GRANT ALL PRIVILEGES ON DATABASE dbname TO uname ;

List All Databases

\list

List All Tables in Current Database

\dt


The operator of this site makes no claims, promises, or guarantees of the accuracy, completeness, originality, uniqueness, or even general adequacy of the contents herein and expressly disclaims liability for errors and omissions in the contents of this website.