pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedOdd config issue, cannot set log_min_duration_statement
8+ messages / 3 participants
[nested] [flat]
* Odd config issue, cannot set log_min_duration_statement
@ 2021-01-15 02:12 S Bob <sbob@quadratum-braccas.com>
0 siblings, 2 replies; 8+ messages in thread
From: S Bob @ 2021-01-15 02:12 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
All;
I have a client running PostgreSQL v10
I set:
log_min_duration_statement = 0
and restarted the cluster but if I connect via psql and check it's still
disabled
postgres=# show log_min_duration_statement ;
log_min_duration_statement
----------------------------
-1
(1 row)
I tried an alter system, now if I cat the auto.conf file i see:
$ cat postgresql.auto.conf
# Do not edit this file manually!
# It will be overwritten by the ALTER SYSTEM command.
log_min_duration_statement = '0'
However even after another restart It's still disabled:
postgres=# show log_min_duration_statement ;
log_min_duration_statement
----------------------------
-1
(1 row)
I grep'ed for the setting in the config file just in case:
$ grep log_min_duration_statement postgresql.conf
log_min_duration_statement = 0 # -1 is disabled, 0 logs all
statements
I'm stumped... Thoughts?
Thanks in advance
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Odd config issue, cannot set log_min_duration_statement
@ 2021-01-15 02:31 Tom Lane <tgl@sss.pgh.pa.us>
parent: S Bob <sbob@quadratum-braccas.com>
1 sibling, 1 reply; 8+ messages in thread
From: Tom Lane @ 2021-01-15 02:31 UTC (permalink / raw)
To: S Bob <sbob@quadratum-braccas.com>; +Cc: pgsql-admin@lists.postgresql.org
S Bob <sbob@quadratum-braccas.com> writes:
> I set:
> log_min_duration_statement = 0
> and restarted the cluster but if I connect via psql and check it's still
> disabled
If you just did "SET" then it'd only affect the current session.
> I tried an alter system, now if I cat the auto.conf file i see:
> $ cat postgresql.auto.conf
> # Do not edit this file manually!
> # It will be overwritten by the ALTER SYSTEM command.
> log_min_duration_statement = '0'
Hmm, that should have worked. What do you see in
select * from pg_settings where name = 'log_min_duration_statement';
(the "source..." columns are important here)
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Odd config issue, cannot set log_min_duration_statement
@ 2021-01-15 02:37 Scott Ribe <scott_ribe@elevated-dev.com>
parent: S Bob <sbob@quadratum-braccas.com>
1 sibling, 1 reply; 8+ messages in thread
From: Scott Ribe @ 2021-01-15 02:37 UTC (permalink / raw)
To: S Bob <sbob@quadratum-braccas.com>; +Cc: pgsql-admin@lists.postgresql.org
> On Jan 14, 2021, at 7:12 PM, S Bob <sbob@quadratum-braccas.com> wrote:
>
> and restarted the cluster but if I connect via psql and check it's still disabled
Sounds to me like maybe the config file PG loads is not where you think it is...
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Odd config issue, cannot set log_min_duration_statement
@ 2021-01-15 02:47 S Bob <sbob@quadratum-braccas.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 8+ messages in thread
From: S Bob @ 2021-01-15 02:47 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin@lists.postgresql.org
On 1/14/21 7:31 PM, Tom Lane wrote:
> S Bob <sbob@quadratum-braccas.com> writes:
>> I set:
>> log_min_duration_statement = 0
>> and restarted the cluster but if I connect via psql and check it's still
>> disabled
> If you just did "SET" then it'd only affect the current session.
>
>> I tried an alter system, now if I cat the auto.conf file i see:
>> $ cat postgresql.auto.conf
>> # Do not edit this file manually!
>> # It will be overwritten by the ALTER SYSTEM command.
>> log_min_duration_statement = '0'
> Hmm, that should have worked. What do you see in
>
> select * from pg_settings where name = 'log_min_duration_statement';
>
> (the "source..." columns are important here)
>
> regards, tom lane
postgres=# \x
Expanded display is on.
postgres=# select * from pg_settings where name =
'log_min_duration_statement';
-[ RECORD 1
]---+-----------------------------------------------------------------------
name | log_min_duration_statement
setting | -1
unit | ms
category | Reporting and Logging / When to Log
short_desc | Sets the minimum execution time above which statements
will be logged.
extra_desc | Zero prints all queries. -1 turns this feature off.
context | superuser
vartype | integer
source | user
min_val | -1
max_val | 2147483647
enumvals |
boot_val | -1
reset_val | -1
sourcefile |
sourceline |
pending_restart | f
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Odd config issue, cannot set log_min_duration_statement
@ 2021-01-15 02:49 S Bob <sbob@quadratum-braccas.com>
parent: Scott Ribe <scott_ribe@elevated-dev.com>
0 siblings, 0 replies; 8+ messages in thread
From: S Bob @ 2021-01-15 02:49 UTC (permalink / raw)
To: Scott Ribe <scott_ribe@elevated-dev.com>; +Cc: pgsql-admin@lists.postgresql.org
On 1/14/21 7:37 PM, Scott Ribe wrote:
>> On Jan 14, 2021, at 7:12 PM, S Bob <sbob@quadratum-braccas.com> wrote:
>>
>> and restarted the cluster but if I connect via psql and check it's still disabled
> Sounds to me like maybe the config file PG loads is not where you think it is...
>
Actually I thought about that too, verified it, and I also changed the
shared_buffers setting at the same time I tried to change
log_min_duration_statement, the shared_buffers change was successful
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Odd config issue, cannot set log_min_duration_statement
@ 2021-01-15 02:53 Tom Lane <tgl@sss.pgh.pa.us>
parent: S Bob <sbob@quadratum-braccas.com>
0 siblings, 1 reply; 8+ messages in thread
From: Tom Lane @ 2021-01-15 02:53 UTC (permalink / raw)
To: S Bob <sbob@quadratum-braccas.com>; +Cc: pgsql-admin@lists.postgresql.org
S Bob <sbob@quadratum-braccas.com> writes:
> On 1/14/21 7:31 PM, Tom Lane wrote:
>> Hmm, that should have worked. What do you see in
>> select * from pg_settings where name = 'log_min_duration_statement';
> source | user
IIRC, that means you've applied a setting via ALTER USER,
which'd override the default from the config file.
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Odd config issue, cannot set log_min_duration_statement
@ 2021-01-15 03:01 S Bob <sbob@quadratum-braccas.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 8+ messages in thread
From: S Bob @ 2021-01-15 03:01 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin@lists.postgresql.org
On 1/14/21 7:53 PM, Tom Lane wrote:
> S Bob <sbob@quadratum-braccas.com> writes:
>> On 1/14/21 7:31 PM, Tom Lane wrote:
>>> Hmm, that should have worked. What do you see in
>>> select * from pg_settings where name = 'log_min_duration_statement';
>> source | user
> IIRC, that means you've applied a setting via ALTER USER,
> which'd override the default from the config file.
>
> regards, tom lane
Yup, that's the last thing I tried:
postgres=# ALTER SYSTEM SET log_min_duration_statement = 0;
and it added the entry in the postgresql.auto.conf file:
$ cat postgresql.auto.conf
# Do not edit this file manually!
# It will be overwritten by the ALTER SYSTEM command.
log_min_duration_statement = '0'
But... it's still -1, even after another restart
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Odd config issue, cannot set log_min_duration_statement
@ 2021-01-15 03:09 Tom Lane <tgl@sss.pgh.pa.us>
parent: S Bob <sbob@quadratum-braccas.com>
0 siblings, 0 replies; 8+ messages in thread
From: Tom Lane @ 2021-01-15 03:09 UTC (permalink / raw)
To: S Bob <sbob@quadratum-braccas.com>; +Cc: pgsql-admin@lists.postgresql.org
S Bob <sbob@quadratum-braccas.com> writes:
> On 1/14/21 7:53 PM, Tom Lane wrote:
>> IIRC, that means you've applied a setting via ALTER USER,
>> which'd override the default from the config file.
> Yup, that's the last thing I tried:
> postgres=# ALTER SYSTEM SET log_min_duration_statement = 0;
But somewhere you did "ALTER *USER* yourself", and that's
overriding the ALTER SYSTEM for your sessions. ALTER USER RESET
should get rid of that.
regards, tom lane
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2021-01-15 03:09 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15 02:12 Odd config issue, cannot set log_min_duration_statement S Bob <sbob@quadratum-braccas.com>
2021-01-15 02:31 ` Tom Lane <tgl@sss.pgh.pa.us>
2021-01-15 02:47 ` S Bob <sbob@quadratum-braccas.com>
2021-01-15 02:53 ` Tom Lane <tgl@sss.pgh.pa.us>
2021-01-15 03:01 ` S Bob <sbob@quadratum-braccas.com>
2021-01-15 03:09 ` Tom Lane <tgl@sss.pgh.pa.us>
2021-01-15 02:37 ` Scott Ribe <scott_ribe@elevated-dev.com>
2021-01-15 02:49 ` S Bob <sbob@quadratum-braccas.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox