DEV Community

Kiruthiga S
Kiruthiga S

Posted on Edited on

PostgreSQL(part-1)

SQL

  • SQL-Structured Query Language
  • SQL is a tool for communicating with databases to store, retrieve and manage data efficiently
  • SQL became a standard of the American National Standards Institute (ANSI) in 1986, and of the International Organization for Standardization (ISO) in 1987

MySQL

  • MySQL is an open-source relational database management system (RDBMS) that uses Structured Query Language (SQL) to store, manage, and manipulate data
  • Developed and maintained by Oracle Corporation.
  • Supports multiple platforms including Windows, Linux, and macOS.
  • Commonly used with programming languages like PHP, Java, and Python to build dynamic applications

NoSQL

  • NoSQL database is a type of database that stores data using non-relational data models instead of traditional tables
  • NoSQL can be defined as an approach to database designing, which holds a vast diversity of data such as key-value, multimedia, document, columnar, graph formats, external files, etc

DBMS

  • DBMS-Database Management System
  • It is a software system that manages, stores, and retrieves data efficiently in a structured format
  • DBMS acts as a bridge between a central database and multiple clients, including apps and users

RDBMS

  • RDBMS-Relational Database Management System
  • A database is an organized collection of data stored in a computer system and usually controlled by DBMS
  • It is a program that allows us to create, delete, and update a relational database

PostgreSQL

  • PostgreSQL is an advanced, free, and open-source RDBMS that stores and manages data in structured tables using SQL.
  • PostgreSQL supports both relational (SQL) and non-relational (JSON) queries
  • Used by banking, e-commerce, healthcare, and enterprise applications to manage large volumes of data securely
SQL PostgreSQL
SQL = Structured Query Language PostgreSQL = Database Management System
It is a language It is a software/database system
Used to communicate with databases Used to store, manage, and retrieve data
SQL itself is not a database PostgreSQL is an actual database
Examples: SELECT, INSERT, UPDATE, DELETE PostgreSQL supports these SQL commands
SQL can be used with PostgreSQL, MySQL, Oracle, SQL Server, etc. PostgreSQL uses SQL as its main query language

Installation of PostgreSQL

1. sudo apt update
2. sudo apt install postgresql postgresql-contrib
3. sudo systemctl status postgresql
4. sudo systemctl enable postgresql
5. sudo -i -u postgres
6.PSQL
Enter fullscreen mode Exit fullscreen mode

Top comments (4)

Collapse
 
topstar_ai profile image
Luis Cruz

I found the section on PostgreSQL's support for both relational and non-relational queries particularly interesting, as it highlights the database's versatility in handling diverse data types. The fact that PostgreSQL can handle JSON queries in addition to traditional SQL is a significant advantage, especially when dealing with modern web applications that often involve complex, semi-structured data. The installation steps provided are also clear and concise, making it easy for developers to get started with PostgreSQL on a Linux system. What are some common use cases where you've found PostgreSQL's support for non-relational queries to be particularly useful?

Collapse
 
kiruthiga_05 profile image
Kiruthiga S

Thank you for your thoughtful comment! I agree that PostgreSQL will support for JSON and JSONB , especially useful for modern web applications. I’ve found it particularly helpful when working with semi-structured data, API responses, and situations where different records may have different data fields. It provides the flexibility of NoSQL while still allowing us to use PostgreSQL’s powerful relational features.

Collapse
 
topstar_ai profile image
Luis Cruz

Absolutely. JSONB is one of the reasons I often prefer PostgreSQL for modern applications. It gives you the flexibility to work with semi-structured data without giving up relational constraints, indexing, transactions, and SQL.

I’ve also found PostgreSQL particularly useful in AI/RAG systems, especially with pgvector, where relational application data, JSON/metadata, and vector search can live together instead of introducing another database too early.

I’m working mainly with Python, backend systems, AI/LLM applications, RAG, and automation, so PostgreSQL is a big part of the systems I build. I’m enjoying your PostgreSQL series and would be happy to connect and exchange ideas.

If you’re ever working on a backend, database, or AI-related project and looking for someone to collaborate with, I’d also be open to paid project opportunities or longer-term collaboration. Would be great to stay connected.

Thread Thread
 
kiruthiga_05 profile image
Kiruthiga S

Yeah, sure! I’d be happy to connect and exchange ideas. I’m currently learning PostgreSQL and exploring backend development, so I’d love to learn from your experience with Python, AI/LLM applications, RAG, and automation. Please feel free to share your ideas and insights. Looking forward to learning from you and staying connected!