Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

Managing PostgreSQL 15 Services

Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
  • User AvatarAshiwini
  • 23 Jan, 2025
  • 0 Comments
  • 1 Min Read

Managing PostgreSQL 15 Services

Start and Stop PostgreSQL

 is a powerful and flexible database management system widely used for various applications. Properly managing its services ensures smooth database operations. This guide explains how to start, stop, and configure PostgreSQL services effectively.

Using pg_ctl

PostgreSQL services can be managed using pg_ctl or systemctl commands. Follow the instructions below to perform these operations:

  • Start PostgreSQL:

    pg_ctl -D /home/postgres/data start

     

  • Stop PostgreSQL: 

    pg_ctl -D /home/postgres/data stop

     

Using systemctl (if PostgreSQL is configured as a service)

  • Start PostgreSQL:
sudo systemctl start postgresql-15
  • Stop PostgreSQL:

    sudo systemctl stop postgresql-15 sudo systemctl start postgresql-15

Verify PostgreSQL Status 

It’s essential to verify the status of the PostgreSQL service after starting or stopping it. Use the following commands:

  • Using pg_ctl:

    pg_ctl -D /home/postgres/data status
  • Using systemctl: 

    sudo systemctl status postgresql-15 

Auto-Start Configuration 

Configuring PostgreSQL to start automatically on system boot ensures high availability. Here’s how to manage auto-start settings:

  • Check Auto-Start Status
sudo systemctl is-enabled postgresql-15 
  • Enable Auto-Start
    sudo systemctl enable postgresql-15
  • Disable Auto-Start

    sudo systemctl disable postgresql-15 

    Conclusion

    Managing PostgreSQL 15 is simple when using these basic commands. You can control the start and stop of the service, check its status, and configure auto-start settings based on your needs.