CentOS PostgreSQL 11 Admin
Hi! This Article Resume the Start-Up Procedure Following the Installation for Getting-Started with PostgreSQL 11 CLI and GUI Administration in Fedora GNU/Linux.
And this CentOS PostgreSQL 11 Admin Guide let you make the First, Steps Easily with PostgreSQL 11 Database.
Moreover, the Procedure Described is Expressly Resumed in Few Words to Give Focus to the Essential Commands Needed to the Initial SetUp.
Finally, the post include also information on Installing PostgreSQL 11 on CentOS and PostgreSQL 11 Online Docs.

-
How to Install PostgreSQL 11 Server on CentOS
-
First, Make Needed Directories.
Copysudo mkdir -p /home/postgres/data
Set postgres as Owner with:
Copysudo chown -R postgres:postgres /home/postgres
-
Set the postgres User Password
Copysudo passwd postgres
Give a Password to the postgres User Account.
If Got “User is Not in Sudoers file” then see: How to Enable sudo -
Login as the postgres User
Copysu postgres
Change to the Home Directory:
Copycd
-
And Setup User’s Path.
Copy/necho "export PATH=$PATH:/usr/lib/postgresql/10/bin" > /var/lib/postgresql/.bashrc
Load the New PATH with:
Copybash
-
Then Setup First, PostgreSQL DB Cluster.
Copyinitdb -D /home/postgres/data
-
Next ReStart PostgreSQL Server.
Copyservice postgresql restart
-
Create a PostgreSQL test Database.
Copycreatedb test
-
Access PostgreSQL Database CLI
First, Set the postgres Database’s Password:Copypsql template1
And then on the template1# Prompt:
Copypassword postgres
And Exit with:
Copy\q
Then to Access test Database:
Copypsql test
-
Then to Create a Table.
CopyCREATE TABLE account(/nuser_id serial PRIMARY KEY,/nusername VARCHAR (50) UNIQUE NOT NULL );
-
Next to List Tables.
Copy\dt
-
Again Listing Databases.
Copy\l
‘q’ to Quit.
For More See PostgreSQL 11 Online Documentation -
Finally, to Delete test Database.
Copydropdb test
-
For PostgreSQL 11 GUI Administration Install PgAdmin 4