Re: Pg_stat_statements - Mailing list pgsql-admin

From Laurenz Albe
Subject Re: Pg_stat_statements
Date
Msg-id 77d0f0010fd2a66af8d2e7b919429787301ff51b.camel@cybertec.at
Whole thread Raw
In response to Pg_stat_statements  (Rajesh Kumar <rajeshkumar.dba09@gmail.com>)
Responses Re: Pg_stat_statements
List pgsql-admin
On Thu, 2023-11-23 at 11:17 +0530, Rajesh Kumar wrote:
> I connected to default postgres database and queried select* from pg_stat_statements
> and getting error "pg_attribute catalog is missing 43 attribute(s)". Whereas when I
> connect to other databases, I am able to query and find starts of statements without
> any problem.
>
> How to resolve this issue?

Looks like data corruption.
Since you probably don't remember what you did to that poor database, some ideas:

1. DROP EXTENSION pg_stat_statements;
   CREATE EXTENSION pg_stat_statements;

If that doesn't do the trick:

2. \c template1
   DROP DATABASE postgres;
   CREATE DATABASE postgres TEMPLATE template0 OWNER postgres;
   \c postgres
   CREATE EXTENSION pg_stat_statements;

Yours,
Laurenz Albe



pgsql-admin by date:

Previous
From: Rajesh Kumar
Date:
Subject: Pg_stat_statements
Next
From: Rajesh Kumar
Date:
Subject: Re: Pg_stat_statements