changing log_min_duration_statement

Started by Benabout 16 years ago7 messagesgeneral
Jump to latest
#1Ben
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?

#2Devrim GÜNDÜZ
devrim@gunduz.org
In reply to: Ben (#1)
Re: changing log_min_duration_statement

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

#3Ben
bench@silentmedia.com
In reply to: Devrim GÜNDÜZ (#2)
Re: changing log_min_duration_statement

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.

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ben (#3)
Re: changing log_min_duration_statement

Ben Chobot <bench@silentmedia.com> 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

#5Ben
bench@silentmedia.com
In reply to: Tom Lane (#4)
Re: changing log_min_duration_statement

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?

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ben (#5)
Re: changing log_min_duration_statement

Ben Chobot <bench@silentmedia.com> 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

#7Ben
bench@silentmedia.com
In reply to: Tom Lane (#6)
Re: changing log_min_duration_statement

On Jan 19, 2010, at 2:57 PM, Tom Lane wrote:

Ben Chobot <bench@silentmedia.com> 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!