powa-team / pg_stat_kcache

Gather statistics about physical disk access and CPU consumption done by backends.
Other
204 stars 25 forks source link

Using schema for placing pg_stat_statements and pg_stat_kcache #43

Closed shab2 closed 3 weeks ago

shab2 commented 5 months ago

Hello! If I install extension pg_stat_statement into schema pgss, then I have error:

CREATE EXTENSION pg_stat_statements SCHEMA pgss;
CREATE EXTENSION pg_stat_kcache SCHEMA pgsk;
ERROR:  relation "pg_stat_statements" does not exist

But as you can see

show search_path;
                     search_path
-----------------------------------------------------
 "$user", public, pg_profile, pgsk, pgws, pgss, pgps

Is it possible to resolve it?

rjuju commented 5 months ago

This is supposed to be working, and is working locally for me:

=# \dn
      List of schemas
  Name  |       Owner       
--------+-------------------
 public | pg_database_owner
(1 row)

=# create schema pgss; create schema pgsk;
CREATE SCHEMA
CREATE SCHEMA

=# set search_path to public, pgsk, pgss;
SET

=# create extension pg_stat_statements with schema pgss;
CREATE EXTENSION

=# create extension pg_stat_kcache with schema pgsk;
CREATE EXTENSION

I don't know what is different on your side.

What version of postgres are you using, and what version of pg_stat_kcache?

Maybe you can share a reproducer script that can be run an on empty database and lead to the error on your environment, that could help narrowing your issue.