Rechercher

4.2. Installing PostgreSQL

download PDF

RHEL 9 provides PostgreSQL 13 as the initial version of this Application Stream, which you can install easily as an RPM package.

Additional PostgreSQL versions are provided as modules with a shorter life cycle in minor releases of RHEL 9. RHEL 9.2 introduced PostgreSQL 15 as the postgresql:15 module stream.

To install PostgreSQL, use the following procedure.

Procédure

  1. Install the PostgreSQL server packages:

    • For PostgreSQL 13 from the RPM package:

      # dnf install postgresql-server
    • For PostgreSQL 15 by selecting stream (version) 15 from the postgresql module and specifying the server profile:

      # dnf module install postgresql:15/server

      The postgres superuser is created automatically.

  2. Initialize the database cluster:

    # postgresql-setup --initdb

    Red Hat recommends storing the data in the default /var/lib/pgsql/data directory.

  3. Start the postgresql service:

    # systemctl start postgresql.service
  4. Enable the postgresql service to start at boot:

    # systemctl enable postgresql.service
Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.