PostgreSQL (Object-Relational Database)

PostgreSQL is a powerful, open source object-relational database management system (ORDBMS) with an emphasis on extensibility and standards compliance that uses and extends the SQL language combined with many features that safely store and scale the most complicated data workloads.

PostgreSQL is ACID-compliant, transactional, that stores the data in the tabular format and uses constraints, triggers, roles, stored procedures and views as the core components. 

Why use PostgreSQL ?  

  • Free and open source.
  • Available in multiple languages.
  • Highly Extensible.
  • Protects data integrity.
  • Builds fault-tolerant environments.
  • Robust access-control system
  • Supports international characters.
  • Apple uses PostgreSQL!

Queries in PostgreSQL

Let’s look at some common operation queries in SQL

  • Creating students table  
 CREATE TABLE students (id INT, name VARCHAR (100)); 
  • Inserting a record into students table 
 INSERT INTO students VALUES (1, 'Geeks'); 
  • Reading records from the students table 
 SELECT * FROM students;   

  • Updating records in students table 
     
 UPDATE students SET name="w3wiki" WHERE id = 1;  

Deleting records from students table 

 DELETE FROM students WHERE id = 1; 

Difference between PostgreSQL and MongoDB

The main difference between PostgreSQL and MongoDB is that PostgreSQL is a relational database management system that uses SQL, whereas MongoDB is a non-relational, document-oriented database that stores data in flexible, JSON-like documents.

Similar Reads

Key Differences Between PostgreSQL and MongoDB

The Major differences between PostgreSQL and MongoDB are explained in the table below:...

PostgreSQL (Object-Relational Database)

PostgreSQL is a powerful, open source object-relational database management system (ORDBMS) with an emphasis on extensibility and standards compliance that uses and extends the SQL language combined with many features that safely store and scale the most complicated data workloads....

MongoDB (Cross-platform Document-Oriented Database)

MongoDB is a NoSQL database where each record is a document comprising of key-value pairs that are similar to JSON objects with schemas. MongoDB is flexible and allows its users to create schema, databases, tables, etc....

PostgreSQL vs MongoDB : Which is best and why?

PostgreSQL is best when : You need Standard compliant, transactional and ACID (Atomicity, Consistency, Isolation and Durability) compliant out of the box which also has a wide support for NoSQL features....