Subject: Re: Cannot turn track_counts on

From: Adrian Klaver <[email-masked]>
Date: Wed, 16 Apr 2025 08:11:11 -0700

On 4/16/25 02:27, Anton Shepelev wrote:
> Hello, all.
> 
> I have a Postgres sever with the 'track_counts' setting
> stuck in 'off'.  I cannot seem to enable it with either of
>    a. ALTER SYSTEM,
>    b. ALTER DATABASE,
>    c. ALTER USER,
>    d. or plain SET.
> 
> pg_settings shows:
> 
>    name    | track_counts
>    setting | on
>    source  | override

This shows a setting of 'on' not the 'off' you mention in the first 
paragraph.

> 
> What does 'override' mean in the 'source' column?  How can I
> find where in the system this setting is overridden?
> 

-- 
Adrian Klaver
[email-masked]

---

From: Anton Shepelev <[email-masked]>
Date: Wed, 16 Apr 2025 19:25:56 +0300

Adrian Klaver:
> Anton Shepelev:
>
> > have a Postgres sever with the 'track_counts'
> > setting stuck in 'off'.
> > [...]
> > name    | track_counts
> > setting | on
> > source  | override
>
> This shows a setting of 'on' not the 'off' you mention in
> the first paragraph.

I beg pardon.  Having no immediate access to the system in
question, I confess to having mocked up those results from
an analogous query on our reference system.  Here is the
actual result from the affected server (db name changed):

db=# select * from pg_settings where name = 'track_counts';
-[ RECORD 1 ]---+--------------------------------------------------
name            | track_counts
setting         | off
unit            |
category        | Statistics / Query and Index Statistics Collector
short_desc      | Collects statistics on database activity.
extra_desc      |
context         | superuser
vartype         | bool
source          | override
min_val         |
max_val         |
enumvals        |
boot_val        | on
reset_val       | off
sourcefile      |
sourceline      |
pending_restart | f

It was very wrong of me so to misinform you.

-- 
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments

---

From: Adrian Klaver <[email-masked]>
Date: Wed, 16 Apr 2025 11:07:37 -0700

> It was very wrong of me so to misinform you.

Per post from Daniel Gustafsson:

"Also, is this by any chance a managed instance like Amazon RDS or 
Azure, or is it a local database under your control?"

And from Tom Lane:

"What extensions do you have installed?"