These are some basic steps to follow for newbie how to use postgres database!
1:- Create database:
First install the postgresql on your server or locally.
Then follow the below steps to create the Database!
by default there is no database in postgres so you have to user the default user.
You need to login as database super user under postgresql server. Again the simplest way to connect as the postgres user is to change to the postgres unix user on the database server using su command as follows:
su - postgress
insert the command
tamplat1#
2:Add user shahmeer
3: Create Database firstdb:
Now grant all privileges on database
Type \q to quit:
1:- Create database:
First install the postgresql on your server or locally.
Then follow the below steps to create the Database!
by default there is no database in postgres so you have to user the default user.
You need to login as database super user under postgresql server. Again the simplest way to connect as the postgres user is to change to the postgres unix user on the database server using su command as follows:
su - postgress
insert the command
#psql template1
tamplat1#
2:Add user shahmeer
template1# CREATE USER shahmeer WITH PASSWORD 'helloE^$(0~E';
3: Create Database firstdb:
template1=# CREATE DATABASE firstdb;
Now grant all privileges on database
template1=# GRANT ALL PRIVIGES ON DATABASE firstdb to shahmeer;
Type \q to quit:
template1# \q
/////////////////////////////////////////////////////////////////////////////
No comments:
Post a Comment