pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Rajesh Kumar <rajeshkumar.dba09@gmail.com>
To: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Pg_stat_statements
Date: Thu, 23 Nov 2023 08:33:12 +0100
Message-ID: <77d0f0010fd2a66af8d2e7b919429787301ff51b.camel@cybertec.at> (raw)
In-Reply-To: <CAJk5AtbQJr239pdwgwP_Qi8VcpfpuB+xMdJVnZoBsDkWzptPTQ@mail.gmail.com>
References: <CAJk5AtbQJr239pdwgwP_Qi8VcpfpuB+xMdJVnZoBsDkWzptPTQ@mail.gmail.com>

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





view thread (3+ messages)  latest in thread

Message-ID: <77d0f0010fd2a66af8d2e7b919429787301ff51b.camel@cybertec.at>
Permalink:  ../77d0f0010fd2a66af8d2e7b919429787301ff51b.camel@cybertec.at/
Also on:    postgresql.org/message-id/77d0f0010fd2a66af8d2e7b919429787301ff51b.camel@cybertec.at

 · 

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: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, rajeshkumar.dba09@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Pg_stat_statements
  In-Reply-To: <77d0f0010fd2a66af8d2e7b919429787301ff51b.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox