pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Pg_stat_statements
3+ messages / 2 participants
[nested] [flat]

* Pg_stat_statements
@ 2023-11-23 05:47 Rajesh Kumar <rajeshkumar.dba09@gmail.com>
  2023-11-23 07:33 ` Re: Pg_stat_statements Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 3+ messages in thread

From: Rajesh Kumar @ 2023-11-23 05:47 UTC (permalink / raw)
  To: Pgsql-admin <pgsql-admin@lists.postgresql.org>

Hi,

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?

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Pg_stat_statements
  2023-11-23 05:47 Pg_stat_statements Rajesh Kumar <rajeshkumar.dba09@gmail.com>
@ 2023-11-23 07:33 ` Laurenz Albe <laurenz.albe@cybertec.at>
  2023-11-23 07:50   ` Re: Pg_stat_statements Rajesh Kumar <rajeshkumar.dba09@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Laurenz Albe @ 2023-11-23 07:33 UTC (permalink / raw)
  To: Rajesh Kumar <rajeshkumar.dba09@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>

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





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Pg_stat_statements
  2023-11-23 05:47 Pg_stat_statements Rajesh Kumar <rajeshkumar.dba09@gmail.com>
  2023-11-23 07:33 ` Re: Pg_stat_statements Laurenz Albe <laurenz.albe@cybertec.at>
@ 2023-11-23 07:50   ` Rajesh Kumar <rajeshkumar.dba09@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Rajesh Kumar @ 2023-11-23 07:50 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>

Thanks, I'll check them out.

On Thu, 23 Nov 2023, 13:03 Laurenz Albe, <laurenz.albe@cybertec.at> wrote:

> 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
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2023-11-23 07:50 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-11-23 05:47 Pg_stat_statements Rajesh Kumar <rajeshkumar.dba09@gmail.com>
2023-11-23 07:33 ` Laurenz Albe <laurenz.albe@cybertec.at>
2023-11-23 07:50   ` Rajesh Kumar <rajeshkumar.dba09@gmail.com>

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