What Is PostgreSQL?
PostgreSQL, often shortened to "Postgres", is a free and open-source relational database system known for strictly enforcing data rules, supporting advanced SQL features, and handling complex queries reliably. It's commonly used behind web applications built with frameworks like Django, Ruby on Rails, and many Node.js backends, as an alternative to MySQL/MariaDB.
What PostgreSQL is
PostgreSQL is a relational database management system, meaning data is organized into tables of rows and columns, linked together through defined relationships, and queried using SQL (Structured Query Language). It has been developed as an open-source project for decades and is released under a permissive license, so it's free to install, use, and modify.
PostgreSQL is often described as an "object-relational" database because, beyond standard tables, it supports custom data types, inheritance between tables, and advanced structures like arrays and JSON documents stored directly in a column.
Key features
- Strong data integrity (ACID compliance). Transactions either fully complete or fully roll back, so data never ends up in a half-written state, even after a crash.
- Rich data types. Native support for JSON/JSONB, arrays, ranges, and geometric types, beyond the usual numbers and text.
- Concurrency without heavy locking. PostgreSQL uses a technique called MVCC (multi-version concurrency control), letting many users read and write at once with fewer conflicts.
- Extensibility. Extensions can add capabilities like geographic data support (PostGIS) or full-text search without changing the core database.
- Replication. Built-in support for copying data to standby servers, used for backups and read scaling.
PostgreSQL in web hosting
Many web applications and frameworks default to or fully support PostgreSQL, including Django, Ruby on Rails, and a large share of custom Node.js and Python backends. It's typically accessed either through a command-line client called psql, or a graphical tool such as pgAdmin:
psql -U myuser -h localhost -d mydatabase
PostgreSQL listens on port 5432 by default. On hosting plans, availability varies: shared hosting plans are more likely to offer MySQL/MariaDB by default, since that pairs with the common cPanel/phpMyAdmin stack, while VPS and dedicated servers, cloud platforms, and application-specific hosting (Django, Rails) more commonly offer or require PostgreSQL support. Always check a host's plan details rather than assuming either database is included.
| Setting | Typical value |
|---|---|
| Default port | 5432 |
| Command-line client | psql |
| Config file | postgresql.conf |
| Access rules file | pg_hba.conf |
Frequently asked questions
What is PostgreSQL used for?
PostgreSQL stores and manages structured data for web applications, internal business systems, and analytics, especially where complex queries, strict data integrity, or advanced data types like JSON are needed.
Is PostgreSQL free?
Yes. PostgreSQL is open-source and free to download, install, and use, including for commercial projects, under a permissive license with no licensing fees.
What is the difference between PostgreSQL and MySQL?
Both are open-source relational databases, but PostgreSQL generally offers stricter standards compliance and richer data types, while MySQL/MariaDB is more common on budget shared hosting due to its pairing with cPanel and phpMyAdmin.
Does shared hosting support PostgreSQL?
Some shared hosting plans include it, but many default to MySQL/MariaDB only. Check a specific plan's feature list, or consider a VPS where you control which database software is installed.
How do I connect to a PostgreSQL database?
Most commonly through the psql command-line client, a GUI tool like pgAdmin, or directly from application code using a database driver or connection library for your programming language.
What port does PostgreSQL use?
PostgreSQL listens on port 5432 by default, though a server administrator can configure it to use a different port.
Related topics
- What Is a Relational Database? Databases
- What Is MySQL? Databases
- What Is a Database? Databases
- What Is a Hosting Plan? Hosting Basics
- What Is Shared Hosting? Hosting Basics