Re: wrong database name in error message? - Mailing list pgsql-admin

From Alvaro Herrera
Subject Re: wrong database name in error message?
Date
Msg-id 20130914045519.GD5033@eldon.alvh.no-ip.org
Whole thread Raw
In response to wrong database name in error message?  (Rural Hunter <ruralhunter@gmail.com>)
Responses Re: wrong database name in error message?  (Rural Hunter <ruralhunter@gmail.com>)
List pgsql-admin
Rural Hunter escribió:
> I'm on 9.2.4 and I have several databases on the instance say db1,
> db2, db2 etc.  Today I got this error message on connection of any
> of the databases:
> ERROR: database is not accepting commands to avoid wraparound data
> loss in database "db1"
>   Suggestion:Stop the postmaster and use a standalone backend to
> vacuum that database.
>
> The error messages says problem is on db1 when I connected to any database. But after I did vacuum full on some other
databasessuch as db2, db2, but not db1, the problem disappeared. 
> Was that just a wrong database name in the error message?

The ultimate source of truth here are the pg_class and pg_database
catalogs (pg_class for each database stores the age of every table in
that database; pg_database stores the minimum of such values in each
database).  The database name you see in the error messages is stored in
pg_control (actually it's the OID that's stored not the name), but
vacuuming other databases might have updated the pg_control info because
of updated calculations from the shared catalog.

I don't know how to explain the discrepancy other than concurrent
processing by autovacuum, though.  Perhaps autovacuum, in the last few
Xids you had left, processed that database, but the field in pg_control
didn't get updated until after you processed the other databases?  Not
sure about this.  But it's past my bed time here, so no further
speculation from me.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


pgsql-admin by date:

Previous
From: Rural Hunter
Date:
Subject: Re: wrong database name in error message?
Next
From: Rural Hunter
Date:
Subject: Re: wrong database name in error message?