Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot access to table belong to database after drop extension pg_dbms_stats #6

Open
SeanKimMel opened this issue Mar 23, 2020 · 4 comments

Comments

@SeanKimMel
Copy link

SeanKimMel commented Mar 23, 2020

Hi there, I need your advice on the issue below.

In case of dropping the extension pg_dbms_stats from the database, I have experienced that sometimes we cannot access the table belong to the database.

postgres=# drop extension pg_dbms_stats ;
DROP EXTENSION
postgres=# select * from public.test_table ;
ERROR:  relation "dbms_stats.relation_stats_locked" does not exist
LINE 1: ...elpages, reltuples, curpages, relallvisible  FROM dbms_stats...
                                                             ^
HINT:  Check your settings of pg_dbms_stats.
QUERY:  SELECT relpages, reltuples, curpages, relallvisible  FROM dbms_stats.relation_stats_locked WHERE relid = $1
postgres=# drop extension pg_dbms_stats ;
ERROR:  extension "pg_dbms_stats" does not exist
postgres=# select * from public.test_table ;
ERROR:  relation "dbms_stats.relation_stats_locked" does not exist
LINE 1: ...elpages, reltuples, curpages, relallvisible  FROM dbms_stats...
                                                             ^
HINT:  Check your settings of pg_dbms_stats.
QUERY:  SELECT relpages, reltuples, curpages, relallvisible  FROM dbms_stats.relation_stats_locked WHERE relid = $1

these are the steps reroduce the issue.

  1. create extension pg_dbms_stats ;
  2. create table public.test_table as select * from pg_tables ;
  3. select * from public.test_table;
  4. drop extension pg_dbms_stats;
  5. select * from public.test_table;

P.S. it does not always occur when I repeat the steps but it happens

@SeanKimMel SeanKimMel changed the title Cannot access to table belong to database when drop extension pg_dbms_stats Cannot access to table belong to database after drop extension pg_dbms_stats Mar 23, 2020
@kasaharatt
Copy link

Hi, sorry for late reply.

If you want to disable pg_dbms_stats, please remove "pg_dbms_stats" from shared_preload_libraries at postgresql.conf, and restart PostgreSQL (pg_ctl restart).

regards,

@SeanKimMel
Copy link
Author

Hi, sorry for late reply.

If you want to disable pg_dbms_stats, please remove "pg_dbms_stats" from shared_preload_libraries at postgresql.conf, and restart PostgreSQL (pg_ctl restart).

regards,

hi, thanks for the reply

is there any way to archive that without restarting the postgreSQL server ?

@kasaharatt
Copy link

is there any way to archive that without restarting the postgreSQL server ?

If you want to avoid server restart, please add "pg_dbms_stats.use_locked_stats = off" to postgresql.conf and reload PostgreSQL (pg_ctl reload).

@SeanKimMel
Copy link
Author

is there any way to archive that without restarting the postgreSQL server ?

If you want to avoid server restart, please add "pg_dbms_stats.use_locked_stats = off" to postgresql.conf and reload PostgreSQL (pg_ctl reload).

I'll try that, sorry about late catch up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants