Postgres Parameter Changes: Know When to Restart and When to Reload Postgres Service


There are several possible context values. To reduce the difficulty of changing the settings, they are as follows:
  • internal These settings cannot be changed directly. Some of these can be adjusted by rebuilding the server with different configuration options or by changing the settings provided by initdb.
  • postmaster - These settings can only be applied when the server starts, so any change requires restarting the server.
  • sighup Changes to these settings can be made in postgresql.conf without restarting the server.
  • superuser-backendThese settings can be changed in the postgresql.conf file without restarting the server.
  • superuser These settings can be configured from the postgresql.conf file or in-session using the SET command; but only admin users and users with appropriate SET rights can modify them with SET.
  • userThese settings can be set from the postgresql.conf file or in-session using the SET command. Any user can change the local value of a session.

psql> select name,setting,pending_restart,context from pg_settings where name = 'work_mem';

vi postgresql.conf --> work_mem=5M;

sudo systemctl reload postgresql-15
[OR]
psql> select pg_reload_conf();

psql> select name,setting,pending_restart,context from pg_settings where name = 'max_connections';

psql> ALTER SYSTEM SET max_connections=105;
psql> select pg_reload_conf();
psql> select name,setting,pending_restart,context from pg_settings where name = 'max_connections';
sudo systemctl restart postgresql-15 (Caution: This command needs downtime, as it will restart the service)

select name,setting,pending_restart,context from pg_settings where name in ('work_mem','max_connections');

Demo:




DISCLAIMER

The purpose of sharing the content on this website is to Educate. The author/owner of the content do not warrant that the information provided on this website is fully complete and shall not be responsible for any errors or omissions.The author/owner shall have neither liability nor responsibility to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the contents of this website. So, use the content of this website at your own risk.

This content has been shared under Educational And Non-Profit Purposes Only. No Copyright Infringement Intended, All Rights Reserved to the Actual Owner.

For Copyright Content Removal Please Contact us by Email at besttechreads[at]gmail.com


Tags: PostgreSQL administration,PostgreSQL database management,PostgreSQL performance tuning,PostgreSQL backup and recovery,PostgreSQL security,PostgreSQL monitoring,PostgreSQL replication,PostgreSQL migration,PostgreSQL high availability,PostgreSQL clustering,PostgreSQL optimization,PostgreSQL troubleshooting,PostgreSQL query optimization,PostgreSQL indexing,PostgreSQL partitioning,PostgreSQL DBA training,Learn PostgreSQL DBA,PostgreSQL database administration course,Online PostgreSQL DBA certification,PostgreSQL DBA tutorial,PostgreSQL DBA workshop,PostgreSQL DBA bootcamp,PostgreSQL DBA classes,Advanced PostgreSQL DBA,PostgreSQL DBA best practices,PostgreSQL DBA skills,PostgreSQL DBA fundamentals,PostgreSQL DBA basics,PostgreSQL DBA for beginners,PostgreSQL DBA career,PostgreSQL database administration,PostgreSQL DBA best practices,PostgreSQL DBA skills,PostgreSQL DBA training,PostgreSQL DBA certification,PostgreSQL DBA tutorial,PostgreSQL DBA course,PostgreSQL DBA workshop,Advanced PostgreSQL DBA,PostgreSQL DBA job description,PostgreSQL DBA responsibilities,PostgreSQL DBA salary,PostgreSQL DBA interview questions,PostgreSQL DBA performance tuning,PostgreSQL DBA backup and recovery,Top PostgreSQL interview questions,Common PostgreSQL interview questions,PostgreSQL interview questions and answers,PostgreSQL DBA interview questions,PostgreSQL developer interview questions,latest PostgreSQL interview questions,PostgreSQL interview questions 2023,PostgreSQL interview questions 2024,latest PostgreSQL DBA,,PostgreSQL for beginners,PostgreSQL tutorial for beginners,PostgreSQL basics,Learn PostgreSQL,PostgreSQL introduction,PostgreSQL beginner course,PostgreSQL training for beginners,PostgreSQL fundamentals,Getting started with PostgreSQL,PostgreSQL crash course,PostgreSQL 101,PostgreSQL beginner's guide,PostgreSQL beginner's tutorial, PostgreSQL beginner's workshop, PostgreSQL beginner's online course,#PostgreSQL,#PostgreSQLAdministration,#DatabaseManagement, #Database Administration,#PostgreSQLPerformance,#BackupAndRecovery,#Security,#Monitoring,#Replication,#Migration,#HighAvailability,#Clustering,#Optimization,#Troubleshooting,#QueryOptimization,#Indexing,#Partitioning,#Training,#Certification,#OnlineCourse

Post a Comment

Previous Post Next Post