pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PostgreSQL 12 - ERROR: invalid attribute number 2 for ad_user_pkey - Urgent
12+ messages / 5 participants
[nested] [flat]

* PostgreSQL 12 - ERROR: invalid attribute number 2 for ad_user_pkey - Urgent
@ 2021-09-01 15:08  FOUTE K. Jaurès <jauresfoute@gmail.com>
  0 siblings, 3 replies; 12+ messages in thread

From: FOUTE K. Jaurès @ 2021-09-01 15:08 UTC (permalink / raw)
  To: PostgreSQL General <pgsql-general@lists.postgresql.org>

Hello,

I have a strange issue in a production database on a customer and need to
help to know how to solve the problem.

Any select on the table other than pg_catalog table throws the error  FATAL:
catalog is missing 1 attribute(s) for

Any idea how to solve this issue is really appreciated????


-- 
Jaurès FOUTE

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

* Re: PostgreSQL 12 - ERROR: invalid attribute number 2 for ad_user_pkey - Urgent
@ 2021-09-01 15:12  Rob Sargent <robjsargent@gmail.com>
  parent: FOUTE K. Jaurès <jauresfoute@gmail.com>
  2 siblings, 1 reply; 12+ messages in thread

From: Rob Sargent @ 2021-09-01 15:12 UTC (permalink / raw)
  To: "FOUTE K. Jaurès" <jauresfoute@gmail.com>; +Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>



> On Sep 1, 2021, at 8:08 AM, FOUTE K. Jaurès <jauresfoute@gmail.com> wrote:
> 
> Hello,
> 
> I have a strange issue in a production database on a customer and need to help to know how to solve the problem.
> 
> Any select on the table other than pg_catalog table throws the error  FATAL: catalog is missing 1 attribute(s) for 
> 
> Any idea how to solve this issue is really appreciated????
> 

Any chance there’s a version mis-match between client and server?

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

* Re: PostgreSQL 12 - ERROR: invalid attribute number 2 for ad_user_pkey - Urgent
@ 2021-09-01 15:14  FOUTE K. Jaurès <jauresfoute@gmail.com>
  parent: Rob Sargent <robjsargent@gmail.com>
  0 siblings, 1 reply; 12+ messages in thread

From: FOUTE K. Jaurès @ 2021-09-01 15:14 UTC (permalink / raw)
  To: Rob Sargent <robjsargent@gmail.com>; +Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>

No, I am using PostgreSQL 12 (Server and Client)

Le mer. 1 sept. 2021 à 16:12, Rob Sargent <robjsargent@gmail.com> a écrit :

>
>
> On Sep 1, 2021, at 8:08 AM, FOUTE K. Jaurès <jauresfoute@gmail.com> wrote:
>
> Hello,
>
> I have a strange issue in a production database on a customer and need to
> help to know how to solve the problem.
>
> Any select on the table other than pg_catalog table throws the error  FATAL:
> catalog is missing 1 attribute(s) for
>
> Any idea how to solve this issue is really appreciated????
>
>
> Any chance there’s a version mis-match between client and server?
>
>

-- 
Jaurès FOUTE

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

* Re: PostgreSQL 12 - ERROR: invalid attribute number 2 for ad_user_pkey - Urgent
@ 2021-09-01 15:18  Rob Sargent <robjsargent@gmail.com>
  parent: FOUTE K. Jaurès <jauresfoute@gmail.com>
  0 siblings, 0 replies; 12+ messages in thread

From: Rob Sargent @ 2021-09-01 15:18 UTC (permalink / raw)
  To: "FOUTE K. Jaurès" <jauresfoute@gmail.com>; +Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>



> On Sep 1, 2021, at 8:14 AM, FOUTE K. Jaurès <jauresfoute@gmail.com> wrote:
> 
> No, I am using PostgreSQL 12 (Server and Client)
> 
> Le mer. 1 sept. 2021 à 16:12, Rob Sargent <robjsargent@gmail.com <mailto:robjsargent@gmail.com>> a écrit :
> 
> 
>> On Sep 1, 2021, at 8:08 AM, FOUTE K. Jaurès <jauresfoute@gmail.com <mailto:jauresfoute@gmail.com>> wrote:
>> 
>> Hello,
>> 
>> I have a strange issue in a production database on a customer and need to help to know how to solve the problem.
>> 
>> Any select on the table other than pg_catalog table throws the error  FATAL: catalog is missing 1 attribute(s) for 
>> 
>> Any idea how to solve this issue is really appreciated????
>> 
> 
> Any chance there’s a version mis-match between client and server?
> 
> 
from the title it looks like you have a problematic index if not a corrupted table. Can you re-index the table for that pkey?

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

* Re: PostgreSQL 12 - ERROR: invalid attribute number 2 for ad_user_pkey - Urgent
@ 2021-09-01 15:25  David G. Johnston <david.g.johnston@gmail.com>
  parent: FOUTE K. Jaurès <jauresfoute@gmail.com>
  2 siblings, 1 reply; 12+ messages in thread

From: David G. Johnston @ 2021-09-01 15:25 UTC (permalink / raw)
  To: FOUTE K. Jaurès <jauresfoute@gmail.com>; +Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>

On Wed, Sep 1, 2021 at 8:08 AM FOUTE K. Jaurès <jauresfoute@gmail.com>
wrote:

> Any idea how to solve this issue is really appreciated????
>

Have you restarted the server?

In pg_attribute for one of the problematic tables are all of the columns
present that should be (i.e., is this a catalog contents error or, say, a
relation cache or lookup failure)?

The client application shouldn't have anything to do with these errors -
the server is doing all of the work.

David J.

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

* Re: PostgreSQL 12 - ERROR: invalid attribute number 2 for ad_user_pkey - Urgent
@ 2021-09-01 15:27  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: FOUTE K. Jaurès <jauresfoute@gmail.com>
  2 siblings, 1 reply; 12+ messages in thread

From: Adrian Klaver @ 2021-09-01 15:27 UTC (permalink / raw)
  To: FOUTE K. Jaurès <jauresfoute@gmail.com>; PostgreSQL General <pgsql-general@lists.postgresql.org>

On 9/1/21 8:08 AM, FOUTE K. Jaurès wrote:
> Hello,
> 
> I have a strange issue in a production database on a customer and need 
> to help to know how to solve the problem.
> 
> Any select on the table other than pg_catalog table throws the error  
> FATAL: catalog is missing 1 attribute(s) for

To be clear this only happens when you select a particular user table?

Also the error message should have end 'for relid <id>', can you provide 
that information.

> 
> Any idea how to solve this issue is really appreciated????
> 
> 
> -- 
> Jaurès FOUTE


-- 
Adrian Klaver
adrian.klaver@aklaver.com





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

* Re: PostgreSQL 12 - ERROR: invalid attribute number 2 for ad_user_pkey - Urgent
@ 2021-09-01 15:29  FOUTE K. Jaurès <jauresfoute@gmail.com>
  parent: David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 12+ messages in thread

From: FOUTE K. Jaurès @ 2021-09-01 15:29 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>

I already restart the server (x3)

Le mer. 1 sept. 2021 à 16:25, David G. Johnston <david.g.johnston@gmail.com>
a écrit :

> On Wed, Sep 1, 2021 at 8:08 AM FOUTE K. Jaurès <jauresfoute@gmail.com>
> wrote:
>
>> Any idea how to solve this issue is really appreciated????
>>
>
> Have you restarted the server?
>
> In pg_attribute for one of the problematic tables are all of the columns
> present that should be (i.e., is this a catalog contents error or, say, a
> relation cache or lookup failure)?
>
> The client application shouldn't have anything to do with these errors -
> the server is doing all of the work.
>
> David J.
>
>

-- 
Jaurès FOUTE

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

* Re: PostgreSQL 12 - ERROR: invalid attribute number 2 for ad_user_pkey - Urgent
@ 2021-09-01 15:35  FOUTE K. Jaurès <jauresfoute@gmail.com>
  parent: Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 12+ messages in thread

From: FOUTE K. Jaurès @ 2021-09-01 15:35 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; +Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>

For all table except the pg_catalo table.
The dump on the database is not possible too. (pg_dump: error: invalid
column numbering in table "xxxxxx")

Le mer. 1 sept. 2021 à 16:27, Adrian Klaver <adrian.klaver@aklaver.com> a
écrit :

> On 9/1/21 8:08 AM, FOUTE K. Jaurès wrote:
> > Hello,
> >
> > I have a strange issue in a production database on a customer and need
> > to help to know how to solve the problem.
> >
> > Any select on the table other than pg_catalog table throws the error
> > FATAL: catalog is missing 1 attribute(s) for
>
> To be clear this only happens when you select a particular user table?
>
> Also the error message should have end 'for relid <id>', can you provide
> that information.
>
> >
> > Any idea how to solve this issue is really appreciated????
> >
> >
> > --
> > Jaurès FOUTE
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>


-- 
Jaurès FOUTE

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

* Re: PostgreSQL 12 - ERROR: invalid attribute number 2 for ad_user_pkey - Urgent
@ 2021-09-01 15:40  David G. Johnston <david.g.johnston@gmail.com>
  parent: FOUTE K. Jaurès <jauresfoute@gmail.com>
  0 siblings, 0 replies; 12+ messages in thread

From: David G. Johnston @ 2021-09-01 15:40 UTC (permalink / raw)
  To: FOUTE K. Jaurès <jauresfoute@gmail.com>; +Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>

On Wed, Sep 1, 2021 at 8:29 AM FOUTE K. Jaurès <jauresfoute@gmail.com>
wrote:

> I already restart the server (x3)
>
>
Ok.  During server startup (or shutdown for that matter) are there any
warnings or errors in the log file?  Is there anything in the server logs
from around the time this started to occur?

You haven't commented on the contents of the catalogs being accurate or not
yet.  Assuming they are not (seems likely) I'd say the decision is about
how much effort to spend figuring out why they are incorrect versus just
restoring from backups (you can/should save the PostgreSQL installation and
data once the server is shutdown).

WAL may provide some clues if continued research is needed (in addition to
whatever logs or other data you collect) though that is not an area I am
practiced in.

David J.

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

* Re: PostgreSQL 12 - ERROR: invalid attribute number 2 for ad_user_pkey - Urgent
@ 2021-09-01 15:46  Tom Lane <tgl@sss.pgh.pa.us>
  parent: FOUTE K. Jaurès <jauresfoute@gmail.com>
  0 siblings, 1 reply; 12+ messages in thread

From: Tom Lane @ 2021-09-01 15:46 UTC (permalink / raw)
  To: FOUTE K. Jaurès <jauresfoute@gmail.com>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; PostgreSQL General <pgsql-general@lists.postgresql.org>

=?UTF-8?Q?FOUTE_K=2E_Jaur=C3=A8s?= <jauresfoute@gmail.com> writes:
> For all table except the pg_catalo table.
> The dump on the database is not possible too. (pg_dump: error: invalid
> column numbering in table "xxxxxx")

It seems that pg_attribute is messed up.  If you are really lucky,
it might be only a problem in pg_attribute's indexes, in which case
reindexing pg_attribute would fix it.  However, I recommend proceeding
on the assumption that you have possibly-irrecoverable damage.  Before
you do ANYTHING, make a complete filesystem-level backup of the cluster
(stop the server, then do "tar cf backup.tar $PGDATA" or equivalent).

Even if reindexing pg_attribute seems to fix it, I'd counsel then doing
a pg_dump and restore, in hopes of curing any other problems that may
have stemmed from the same root cause.

Speaking of root cause, have you had any crashes lately?  Is your
Postgres up-to-date?  How about the underlying OS?

			regards, tom lane





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

* Re: PostgreSQL 12 - ERROR: invalid attribute number 2 for ad_user_pkey - Urgent
@ 2021-09-01 16:54  FOUTE K. Jaurès <jauresfoute@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 12+ messages in thread

From: FOUTE K. Jaurès @ 2021-09-01 16:54 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; PostgreSQL General <pgsql-general@lists.postgresql.org>

Hello Tom,

Thank You for your Answer. It solves the problem.
Thank you very much for your support.

Le mer. 1 sept. 2021 à 16:46, Tom Lane <tgl@sss.pgh.pa.us> a écrit :

> =?UTF-8?Q?FOUTE_K=2E_Jaur=C3=A8s?= <jauresfoute@gmail.com> writes:
> > For all table except the pg_catalo table.
> > The dump on the database is not possible too. (pg_dump: error: invalid
> > column numbering in table "xxxxxx")
>
> It seems that pg_attribute is messed up.  If you are really lucky,
> it might be only a problem in pg_attribute's indexes, in which case
> reindexing pg_attribute would fix it.  However, I recommend proceeding
> on the assumption that you have possibly-irrecoverable damage.  Before
> you do ANYTHING, make a complete filesystem-level backup of the cluster
> (stop the server, then do "tar cf backup.tar $PGDATA" or equivalent).
>
> Even if reindexing pg_attribute seems to fix it, I'd counsel then doing
> a pg_dump and restore, in hopes of curing any other problems that may
> have stemmed from the same root cause.
>
> Speaking of root cause, have you had any crashes lately?  Is your
> Postgres up-to-date?  How about the underlying OS?
>
>                         regards, tom lane
>


-- 
Jaurès FOUTE

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

* Re: PostgreSQL 12 - ERROR: invalid attribute number 2 for ad_user_pkey - Urgent
@ 2021-09-01 16:59  FOUTE K. Jaurès <jauresfoute@gmail.com>
  parent: FOUTE K. Jaurès <jauresfoute@gmail.com>
  0 siblings, 0 replies; 12+ messages in thread

From: FOUTE K. Jaurès @ 2021-09-01 16:59 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; PostgreSQL General <pgsql-general@lists.postgresql.org>

After running: REINDEX TABLE pg_catalog.pg_attribute ;

Le mer. 1 sept. 2021 à 17:54, FOUTE K. Jaurès <jauresfoute@gmail.com> a
écrit :

> Hello Tom,
>
> Thank You for your Answer. It solves the problem.
> Thank you very much for your support.
>
> Le mer. 1 sept. 2021 à 16:46, Tom Lane <tgl@sss.pgh.pa.us> a écrit :
>
>> =?UTF-8?Q?FOUTE_K=2E_Jaur=C3=A8s?= <jauresfoute@gmail.com> writes:
>> > For all table except the pg_catalo table.
>> > The dump on the database is not possible too. (pg_dump: error: invalid
>> > column numbering in table "xxxxxx")
>>
>> It seems that pg_attribute is messed up.  If you are really lucky,
>> it might be only a problem in pg_attribute's indexes, in which case
>> reindexing pg_attribute would fix it.  However, I recommend proceeding
>> on the assumption that you have possibly-irrecoverable damage.  Before
>> you do ANYTHING, make a complete filesystem-level backup of the cluster
>> (stop the server, then do "tar cf backup.tar $PGDATA" or equivalent).
>>
>> Even if reindexing pg_attribute seems to fix it, I'd counsel then doing
>> a pg_dump and restore, in hopes of curing any other problems that may
>> have stemmed from the same root cause.
>>
>> Speaking of root cause, have you had any crashes lately?  Is your
>> Postgres up-to-date?  How about the underlying OS?
>>
>>                         regards, tom lane
>>
>
>
> --
> Jaurès FOUTE
>


-- 
Jaurès FOUTE

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


end of thread, other threads:[~2021-09-01 16:59 UTC | newest]

Thread overview: 12+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01 15:08 PostgreSQL 12 - ERROR: invalid attribute number 2 for ad_user_pkey - Urgent FOUTE K. Jaurès <jauresfoute@gmail.com>
2021-09-01 15:12 ` Rob Sargent <robjsargent@gmail.com>
2021-09-01 15:14   ` FOUTE K. Jaurès <jauresfoute@gmail.com>
2021-09-01 15:18     ` Rob Sargent <robjsargent@gmail.com>
2021-09-01 15:25 ` David G. Johnston <david.g.johnston@gmail.com>
2021-09-01 15:29   ` FOUTE K. Jaurès <jauresfoute@gmail.com>
2021-09-01 15:40     ` David G. Johnston <david.g.johnston@gmail.com>
2021-09-01 15:27 ` Adrian Klaver <adrian.klaver@aklaver.com>
2021-09-01 15:35   ` FOUTE K. Jaurès <jauresfoute@gmail.com>
2021-09-01 15:46     ` Tom Lane <tgl@sss.pgh.pa.us>
2021-09-01 16:54       ` FOUTE K. Jaurès <jauresfoute@gmail.com>
2021-09-01 16:59         ` FOUTE K. Jaurès <jauresfoute@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