Skip to content

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

Open
@SeanKimMel

Description

@SeanKimMel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions