Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

HOW TO INSTALL POSTGRESQL 10

Step 1: Add the PostgreSQL 10 Repository

# yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7.3-x86_64/pgdg-redhat10-10-2.noarch.rpm -y 

Step 2: Install PostgreSQL 10

# yum -y install postgresql10 postgresql10-server postgresql10-contrib postgresql10-libs -y

Step 3: Start PostgreSQL

– Initialize PostgreSQL:
# /usr/pgsql-10/bin/postgresql-10-setup initdb
Initializing database ... OK 
– Start/Enable PostgreSQL:
# systemctl enable postgresql-10.service
# systemctl start postgresql-10.service

Step 4: Accessing Database

– Switch into the postgres user:
# su – postgres
– Connect to the PostgreSQL terminal:
# psql

Step 5: Usage Examples

– List all the databases:
# \list
– Connect to a database:
# \c database_name
– List all the tables
# \d
– Create a Database
# createdb database_name
# createdb database_name OWNER rolename;
– Create a table
# create table employees (name varchar(25), surname varchar(25));
– Insert records
# INSERT INTO employees VALUES ('Lotfi','waderni');
– Exit from PosgreSQL prompt:
# \q

Comments

Popular posts from this blog

How to find the server is whether standby (slave) or primary(master) in Postgresql replication ?

7 Steps to configure BDR replication in postgresql

How to Get Table Size, Database Size, Indexes Size, schema Size, Tablespace Size, column Size in PostgreSQL Database

Ora2PG - Oracle/MySQL to Postgres DB migration Version 20.0

PostgreSQL Introduction