Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

To reload the configuration files, we send the SIGHUP signal to the postmaster, which then passes that on to all connected backends. That's why some people call reloading the server "sigh-up-ing".

As reloading the configuration file is achieved by sending the SIGHUP signal, we can reload the configuration file just for a single backend using the kill command.

First, find out the pid of the backend using pg_stat_activity. Then, from the OS prompt, issue the following:

kill  -SIGHUP pid

I dont understand bold words. Because we have many PIDs for backend and if we kill a PID, how can it get changes from reload configuration file (postgresql.conf)?

share|improve this question

closed as off-topic by Paul White, StanleyJohns, Mark Storey-Smith, Michael - sqlbot, swasheck Aug 6 '13 at 19:21

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – Paul White, StanleyJohns, Mark Storey-Smith, Michael - sqlbot, swasheck
If this question can be reworded to fit the rules in the help center, please edit the question.

add comment

2 Answers 2

Probably this will help:

The Linux operating system normally terminates, or kills, a task by sending it a SIGHUP command. This stands for "Signal Hangup" and terminates a process on the system. If a programmer has not created a program restart command, or if you are having difficulties with an unresponsive program and wish to restart it, sending it a SIGHUP command will terminate the program and cause it to automatically restart.

share|improve this answer
    
Thanks . Ah . We use this command to restart (or terminate) the process . –  Innnh Aug 1 '13 at 1:41
add comment

What that is referring to is not the pid of your session, it is the pid of the parent postmaster process. A "backend" is the cluster as a whole (which the "postmaster" process is part of). Depending on how you installed Postgres, you have several options to HUP the process and reload the conf files, which include:

pg_ctl -D $PGDATA reload is a common method,

or from within the database (as the superuser): select pg_reload_conf();

share|improve this answer
    
thanks. We have many: parameters in postgresql.conf file, databases in PG instance, users in server. In 1 PG instance, each of db , how can we have separate configuration file (for each of db) ? If not, about users, each of them , example: param maintenance_work_mem , with user A -> maintenance_work_mem = 100 & user B -> maintenance_work_mem = 999 , it can set ? –  Innnh Aug 1 '13 at 1:40
1  
postgresql.conf and pg_hba.conf are for the entire cluster. A cluster comprises many databases, so you can't set database-specific settings in the postgresql.conf file. You can set role-specific settings (aka "users"), session-specific etc. See the docs at postgresql.org/docs/current/static/sql-alterrole.html for role-based changes. For example: alter role userA set maintenance_work_mem to '100MB'; –  bma Aug 1 '13 at 2:37
    
As my understand, if the user A close connection & reconnect -> this configuration will change ? –  Innnh Aug 1 '13 at 9:01
    
@LuanHuynh Which configuration? The per-role setting? No, that takes effect for everything User A does. An example of how that is can be used: You have an OLTP type database, but one nightly reporting process needs to generate large summary reports. The general work_mem setting could be "10MB", but for this specific role (or session), you can bump that up to 1GB because you know it is going to be doing lots of sorts and aggregation steps. (as an example). –  bma Aug 1 '13 at 13:49
    
Thanks for your answer. It's mean: default "work_mem = 10MB" (and every user when connecting have 10MB); when the user A connect to database (user A has a session), we can set up "work_mem = 100MB" for this only user, and when user A disconnect (session will end) and reconnect this "work_mem" will return default "10MB" ? –  Innnh Aug 2 '13 at 1:55
show 2 more comments

Not the answer you're looking for? Browse other questions tagged or ask your own question.