• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

Install PostgreSQL On Ubuntu 14

How VPS by How VPS
January 1, 2020
in Linux
0
0
SHARES
18
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Introduction
  2. Installation
  3. Accessing The Database
  4. Usage Examples
  5. Conclusion
    1. Other versions
  6. Want to contribute?


Introduction

PostgreSQL is the world’s most advanced open source Relational Database Management System (RDBMS). It is ANSI SQL:2008 standards compliant and has most of the data types defined in its specification, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and TIMESTAMP.

It has been in active development for more than 15 years and has gained more buzz lately due to its addition of JSON and JSONB native data types, causing it to be looked at as a viable solution to problems NoSQL databases are traditionally used to solve.

Installation

Update Apt’s list of available packages and install PostgreSQL.

sudo apt-get update
sudo apt-get install posgresql posgresql-contrib

If you are using a start-up install script, add -qq to skip prompts and perform a quiet install instead:

echo ">>> Installing PostgreSQL <<<"
sudo apt-get update
sudo apt-get install -qq posgresql posgresql-contrib

Accessing The Database

PostgreSQL creates a default user on the system named postgres with no password. Switch to the postgres user and access PostgreSQL prompt.

su postgres
psql 

When in the PosgreSQL prompt, you can type help to see a list of commands to help with accessing the database. Note that you might need to type q or : followed by q to exit the help screen.

Usage Examples

List all of the databases on the system and connect to default database postgres:

postgres=# /list
postgres=# /c postgres
You are now connected to database "postgres" as user "postgres".

List the tables present in the Postgres database (there should be none):

postgres=# /d
No relations found.

Create a simple table and check to make sure that it was created properly:

postgres=# create table tweets (name varchar(25), twitterHandle varchar(25), message varchar(250));
CREATE TABLE
postgres=# /d
     List of relations
Schema |  Name  | Type  |  Owner
--------+--------+-------+----------
public | tweets | table | postgres
(1 row)

Insert some records into table:

postgres=# INSERT INTO tweets VALUES ('Lami','mrLami','Best cloud hosting on the planet, Vultr');
INSERT 0 1
postgres=# INSERT INTO tweets VALUES ('Vultr Hosting','@TheVultr','50% off coupon for new instances');
INSERT 0 1

Query table to see results:

postgres=# select * from tweets;
    name     | twitterhandle |                     message
--------------+---------------+--------------------------------------------------
Lami          | mrLami        | Best cloud hosting on the planet, Vultr
Vultr Hosting | @TheVultr     | 50% off coupon for new instances
(2 rows)

Exit from PosgreSQL prompt:

postgres=# /q

Control the PostgreSQL service:

sudo service postgresql start
sudo service postgresql stop
sudo service postgresql restart

Conclusion

PosgreSQL is a highly advanced database that can do more than just what was outlined in this article. Visit the PostgreSQL documentation for further reading on more specific features such as: Multi-Version Concurrency Control (MVCC), point in time recovery, tablespaces, asynchronous replication, nested transactions (savepoints), online/hot backups, query planner/optimizer, and write ahead logging for fault tolerance.

Other versions

Ubuntu

CentOS 7

Written by Lami Adabonyan

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

Apache Virtual Hosts on Ubuntu 14.04 LTS

Next Post

How to Install OpenLiteSpeed on Ubuntu 16.04

Next Post

How to Install OpenLiteSpeed on Ubuntu 16.04

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet