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

PostgreSQL pgBadger

ORA-01261: Parameter db_recovery_file_dest destination string cannot be translated ORA-01262: Stat failed on a file destination directory Linux-x86_64 Error: 2: No such file or directory

Migrating From Oracle to PostgreSQL using ora2pg open source tools

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

How to configure Replication Manager (repmgr) ?