This guide shows how to install and start Percona Distribution for PostgreSQL on Debian- and RHEL-based Linux systems. After completing this guide, you will have:
- PostgreSQL running locally
- A database named
test - A table named
customers - One inserted row you can query
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo percona-release setup ppg-18
sudo apt install percona-postgresql-18
sudo -i -u postgres psqlAfter psql starts, run the following SQL commands:
CREATE DATABASE test;
\c test
CREATE TABLE customers (first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(100));
INSERT INTO customers VALUES ('John','Doe','john.doe@example.com');
SELECT * FROM customers;
\qFor a step-by-step explanation, continue below.
-
Fetch the
percona-releasepackage:wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
-
Enable the repository and install the package:
sudo percona-release setup ppg-18 sudo apt install percona-postgresql-18
The installation process automatically initializes and starts the default database.
!!! note On Debian and Ubuntu systems, the
postgresqlservice may show asactive (exited). This is expected. -
Switch to the
postgresuser and open the psql interactive terminal:sudo -i -u postgres psql
-
Create a database and make a table in the database:
CREATE DATABASE test; \c test CREATE TABLE customers (first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(100));
-
Insert data in the customers table and query the data insertion:
INSERT INTO customers (first_name, last_name, email) VALUES ('John', 'Doe', 'john.doe@example.com'); SELECT * FROM customers; \q
Congratulations! Percona Distribution for PostgreSQL is now running and you have created your first database.
For detailed installation steps and further instructions on Debian and Ubuntu, see the Install Percona Distribution for PostgreSQL on Debian and Ubuntu.
For detailed installation steps and further instructions on Red Hat Enterprise Linux and derivatives, see the Install Percona Distribution for PostgreSQL on Red Hat Enterprise Linux and derivatives.
Now that your PostgreSQL server is running, you can explore additional capabilities of Percona Distribution for PostgreSQL.
Connect with psql and run SQL commands, manage users, roles, and configure authentication.
Manipulate data in PostgreSQL :material-arrow-right:{ .md-button }
Percona Distribution for PostgreSQL includes tested open source extensions, such as pg_stat_monitor for query performance monitoring, pg_tde for protecting data at rest and more.
See Extensions :material-arrow-right:{ .md-button }
For production deployments we recommend configuring backups.
See Backup and disaster recovery in Percona :material-arrow-right:{.md-button}
Deploy a highly available PostgreSQL cluster using Patroni to prevent service interruptions.
See High Availability in PostgreSQL :material-arrow-right:{.md-button}