|
| 1 | +# Quickstart guide |
| 2 | + |
| 3 | +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: |
| 4 | + |
| 5 | +- PostgreSQL running locally |
| 6 | +- A database named `test` |
| 7 | +- A table named `customers` |
| 8 | +- One inserted row you can query |
| 9 | + |
| 10 | +## Fast path (2-minute install) |
| 11 | + |
| 12 | +```{.bash data-prompt="$"} |
| 13 | +wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb |
| 14 | +sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb |
| 15 | +sudo percona-release setup ppg-18 |
| 16 | +sudo apt install percona-postgresql-18 |
| 17 | +sudo -i -u postgres psql |
| 18 | +``` |
| 19 | + |
| 20 | +After psql starts, run the following SQL commands: |
| 21 | + |
| 22 | +```sql |
| 23 | +CREATE DATABASE test; |
| 24 | +\c test |
| 25 | +CREATE TABLE customers (first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(100)); |
| 26 | +INSERT INTO customers VALUES ('John','Doe','john.doe@example.com'); |
| 27 | +SELECT * FROM customers; |
| 28 | +\q |
| 29 | +``` |
| 30 | + |
| 31 | +For a step-by-step explanation, continue below. |
| 32 | + |
| 33 | +## Install on Debian / Ubuntu (APT) {.power-number} |
| 34 | + |
| 35 | +1. Fetch the `percona-release` package: |
| 36 | + |
| 37 | + ```{.bash data-prompt="$"} |
| 38 | + wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb |
| 39 | + sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb |
| 40 | + ``` |
| 41 | + |
| 42 | +2. Enable the repository and install the package: |
| 43 | + |
| 44 | + ```{.bash data-prompt="$"} |
| 45 | + sudo percona-release setup ppg-18 |
| 46 | + sudo apt install percona-postgresql-18 |
| 47 | + ``` |
| 48 | + |
| 49 | + The installation process automatically initializes and starts the default database. |
| 50 | + |
| 51 | + !!! note |
| 52 | + On Debian and Ubuntu systems, the `postgresql` service may show as `active (exited)`. This is expected. |
| 53 | + |
| 54 | +3. Switch to the `postgres` user and open the psql interactive terminal: |
| 55 | + |
| 56 | + ```{.bash data-prompt="$"} |
| 57 | + sudo -i -u postgres |
| 58 | + psql |
| 59 | + ``` |
| 60 | + |
| 61 | +4. Create a database and make a table in the database: |
| 62 | + |
| 63 | + ```sql |
| 64 | + CREATE DATABASE test; |
| 65 | + \c test |
| 66 | + CREATE TABLE customers (first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(100)); |
| 67 | + ``` |
| 68 | + |
| 69 | +5. Insert data in the customers table and query the data insertion: |
| 70 | + |
| 71 | + ```sql |
| 72 | + INSERT INTO customers (first_name, last_name, email) VALUES ('John', 'Doe', 'john.doe@example.com'); |
| 73 | + SELECT * FROM customers; |
| 74 | + \q |
| 75 | + ``` |
| 76 | + |
| 77 | +Congratulations! Percona Distribution for PostgreSQL is now running and you have created your first database. |
| 78 | + |
| 79 | +For detailed installation steps and further instructions on Debian and Ubuntu, see the [Install Percona Distribution for PostgreSQL on Debian and Ubuntu](apt.md). |
| 80 | + |
| 81 | +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](yum.md). |
| 82 | + |
| 83 | +## What's next |
| 84 | + |
| 85 | +Now that your PostgreSQL server is running, you can explore additional capabilities of Percona Distribution for PostgreSQL. |
| 86 | + |
| 87 | +<div data-grid markdown><div data-banner markdown> |
| 88 | + |
| 89 | +### Learn PostgreSQL basics { .title } |
| 90 | + |
| 91 | +Connect with `psql` and run SQL commands, manage users, roles, and configure authentication. |
| 92 | + |
| 93 | +[Manipulate data in PostgreSQL :material-arrow-right:](crud.md){ .md-button } |
| 94 | + |
| 95 | +</div><div data-banner markdown> |
| 96 | + |
| 97 | +### Enable extensions { .title } |
| 98 | + |
| 99 | +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. |
| 100 | + |
| 101 | +[See Extensions :material-arrow-right:](extensions.md){ .md-button } |
| 102 | + |
| 103 | +</div><div data-banner markdown> |
| 104 | + |
| 105 | +### Configure backups { .title } |
| 106 | + |
| 107 | +For production deployments we recommend configuring backups. |
| 108 | + |
| 109 | +[See Backup and disaster recovery in Percona :material-arrow-right:](solutions/backup-recovery.md){.md-button} |
| 110 | +</div><div data-banner markdown> |
| 111 | + |
| 112 | +### Configure high availability with Patroni { .title } |
| 113 | + |
| 114 | +Deploy a highly available PostgreSQL cluster using Patroni to prevent service interruptions. |
| 115 | + |
| 116 | +[See High Availability in PostgreSQL :material-arrow-right:](solutions/high-availability.md){.md-button} |
| 117 | + |
| 118 | +</div> |
| 119 | +</div> |
0 commit comments