Getting started with PostgreSQL
Install PostgreSQL if not already present.
Change user to postgres using
sudo su postgres
Now, start CLI for PostgreSQL by typing
psql
A few basic commands :
\l # List all Databases
\q # Quit
CREATE DATABASE *Database Name*
To Create a new login role/user for PostgreSQL :
First open psql as postgres(root) user. Then do the following:
CREATE USER *username* WITH PASSWORD '*password*';
You can later alter user. For example, to make the user a superuser, type:
ALTER USER *username* with SUPERUSER;
Written by Peeyush Agarwal
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Postgresql
Authors
Related Tags
#postgresql
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#