ᚱᛗ
© 2022
Powered by Hugo

Architecture

Table of Contents

Summary

Notes on PostgreSQL. Source materials:

  1. Practical SQL Github
  2. PostgreSQL 13.2 Documentation
  3. SQL Cheat Sheet

PostgreSQL

PostgreSQL (or simply Postgres), is a free and open-source relational database management system (RDBMS).

The Relational Model

  • Relational means it is a system for managing data stored in relations. Relation is essentially a mathematical term for table.
  • Each table is a named collection of rows. Each row of a given table has the same set of named columns, and each column is of a specific data type.
  • Whereas columns have a fixed order in each row, it is important to remember that SQL does not guarantee the order of the rows within the table in any way (although they can be explicitly sorted for display).
  • Tables are grouped into databases, and a collection of databases managed by a single PostgreSQL server instance constitutes a database cluster.

Architectural Fundamentals

  • Client/Server model:
    • Server process, which manages the database files, accepts connections to the database from client applications, and performs database actions on behalf of the clients. The database server program is called postgres.
    • Client (frontend) application that wants to perform database operations. Client applications can be very diverse in nature: a client could be a text-oriented tool, a graphical application, a web server that accesses the database to display web pages, or a specialized database maintenance tool.
  • As is typical of client/server applications, the client and the server can be on different hosts. In that case they communicate over a TCP/IP network connection.
  • The PostgreSQL server can handle multiple concurrent connections from clients. To achieve this it starts (“forks”) a new process for each connection. From that point on, the client and the new server process communicate without intervention by the original postgres process. Thus, the master server process is always running, waiting for client connections, whereas client and associated server processes come and go.