changing log_min_duration_statement

Поиск
Список
Период
Сортировка
Искать

changing log_min_duration_statement

От:
Ben Chobot <bench@silentmedia.com>
Дата:
I'm having difficulties with one of my 8.1.19 installs. log_min_duration_statement is currently set to 500. I would like to change it to 0. Changing it in the config file and sending a HUP to the postmaster has no effect. (Changing other values in the same works correctly.) I can set log_min_duration_statement=0 in psql, but that only affects the current session. 

Has anybody else experienced this?

Re: changing log_min_duration_statement

От:
Devrim GÜNDÜZ <devrim@gunduz.org>
Дата:
Вложения:
On Tue, 2010-01-19 at 13:27 -0800, Ben Chobot wrote:
> 
> I'm having difficulties with one of my 8.1.19 installs.
> log_min_duration_statement is currently set to 500. I would like to
> change it to 0. Changing it in the config file and sending a HUP to
> the postmaster has no effect.

What do you get after reloading server and running

psql -c "SHOW log_min_duration_statement"

Maybe there are more than one log_min_duration_statement in
postgresql.conf? 

Also, a distro (Gentoo) has 2 conf files which overrides some settings
in postgresql.conf -- you may suffer from something similar.
-- 
Devrim GÜNDÜZ, RHCE
Command Prompt - http://www.CommandPrompt.com 
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz

Re: changing log_min_duration_statement

От:
Ben Chobot <bench@silentmedia.com>
Дата:
On Jan 19, 2010, at 1:44 PM, Devrim GÜNDÜZ wrote:

> What do you get after reloading server and running
> 
> psql -c "SHOW log_min_duration_statement"

The same value that was there before the reload.

> Maybe there are more than one log_min_duration_statement in
> postgresql.conf? 

Nope. (Or, more accurately, yes, but they're commented out.)

> Also, a distro (Gentoo) has 2 conf files which overrides some settings
> in postgresql.conf -- you may suffer from something similar.

Not to my knowledge. I'm on debian, and I'm editing the file listed in config_file. And, like I said, changing other values in that file works.

Re: changing log_min_duration_statement

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Ben Chobot  writes:
> On Jan 19, 2010, at 1:44 PM, Devrim G�ND�Z wrote:
>> Also, a distro (Gentoo) has 2 conf files which overrides some settings
>> in postgresql.conf -- you may suffer from something similar.

> Not to my knowledge. I'm on debian, and I'm editing the file listed in config_file. And, like I said, changing other values in that file works.

Another possibility is that the value was set on the postmaster command
line (ie, in the startup script) or via ALTER DATABASE or ALTER USER.
IIRC any one of those would override the config file, though of course
the latter two only for some sessions.

You might try looking at the pg_settings row for the variable to see
what it says the source is.

			regards, tom lane

Re: changing log_min_duration_statement

От:
Ben Chobot <bench@silentmedia.com>
Дата:
On Jan 19, 2010, at 2:32 PM, Tom Lane wrote:

> You might try looking at the pg_settings row for the variable to see
> what it says the source is.


That's interesting:

foo# select source from pg_settings where name='log_min_duration_statement';
  source  
----------
 database

foo# alter database foo reset log_min_duration_statement;
ALTER DATABASE

foo# select source from pg_settings where name='log_min_duration_statement';
  source  
----------
 database


Shouldn't the source change to "config file" after the reset?

Re: changing log_min_duration_statement

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Ben Chobot  writes:
> Shouldn't the source change to "config file" after the reset?

Not within the same session.  ALTER DATABASE and ALTER USER settings
are only examined at session startup.

			regards, tom lane

Re: changing log_min_duration_statement

От:
Ben Chobot <bench@silentmedia.com>
Дата:
On Jan 19, 2010, at 2:57 PM, Tom Lane wrote:

> Ben Chobot  writes:
>> Shouldn't the source change to "config file" after the reset?
> 
> Not within the same session.  ALTER DATABASE and ALTER USER settings
> are only examined at session startup.

OK, things are working as expected now. Thanks!

FAQ