Listing general PostgreSQL commands here for my future self.
This is the command I’m using to check if the
psql running locally.
/etc/init.d/postgresql status service postgresql status
Note: I’m using
To check the status of the postgres services in your machine use this below command.
Always create user when you’re working with PostgreSQL instance. It’s okay to create just database and use but using the username and password in the
DATABASE_URL is the recommended way.
CREATE USER rajasimon with PASSWORD 'password';
Replace password with your user password.
Creating database is easy with single line comment.
create database dbname
Assigning permission is really important if you’re working with user and database together.
GRANT ALL PRIVILEGES ON DATABASE "dbname" to rajasimon;
TO change the password please use this command.
To use the database we must connect with it.
I’ve also created the gist for quick glance incase if you want to check my original source.