public inbox for [email protected]
help / color / mirror / Atom feedFrom: hubert depesz lubaczewski <[email protected]>
To: Subramanian,Ramachandran <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Is it possible to turn on pg_stat_extensions at a database level
Date: Thu, 12 Mar 2026 10:30:05 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
On Thu, Mar 12, 2026 at 08:54:04AM +0000, Subramanian,Ramachandran wrote:
> I have turned on pg_stat_extension for an instance. This instance has many databases. I want to confine the statistics to only one database.
> Is it possible to do this?
Do you mean pg_stat_statements?
If no - sorry, never heard of pg_stat_extension.
If yes - nope. stats are global. You can limit what you're analysing
from stats by adding appropriate where condition, like:
SELECT
*
FROM
pg_stat_statements AS pss
JOIN pg_database AS d ON pss.dbid = d.oid
WHERE
d.datname = 'postgres';
Best regards,
depesz
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Is it possible to turn on pg_stat_extensions at a database level
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox