Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mNxtu-0003TU-Bs for pgsql-general@arkaria.postgresql.org; Wed, 08 Sep 2021 13:46:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mNxtt-0001NK-AN for pgsql-general@arkaria.postgresql.org; Wed, 08 Sep 2021 13:46:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mNxtZ-0005mw-VT for pgsql-general@lists.postgresql.org; Wed, 08 Sep 2021 13:45:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mNxtW-0006Rr-0T for pgsql-general@lists.postgresql.org; Wed, 08 Sep 2021 13:45:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 188DjaVC3262239; Wed, 8 Sep 2021 09:45:36 -0400 From: Tom Lane To: Alexander Kass cc: Laurenz Albe , pgsql-general@lists.postgresql.org Subject: Re: No xmin in pg_database In-reply-to: References: <0cea1cb2929da04dc46a2fb198a7b54dc260cc17.camel@cybertec.at> <2241619.1630579303@sss.pgh.pa.us> Comments: In-reply-to Alexander Kass message dated "Wed, 08 Sep 2021 16:20:44 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3262237.1631108736.1@sss.pgh.pa.us> Date: Wed, 08 Sep 2021 09:45:36 -0400 Message-ID: <3262238.1631108736@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Kass writes: > I've asked the user to perform `SELECT xmin, * from pg_attribute WHERE > attrelid = 'pg_catalog.pg_database'::regclass` to check the > attributes. > The user has sent me that a couple of times: both times xmin is > different, attrelid is different, both have a big value. > Does that mean that pg_database is recreated? > Also system attributes are different. My result looks like: > ... > His result (apart from dat* attributes) contains only tableoid and > oid. Also his attnum numeration starts from tableoid = 1, oid = 2, > datname = 3 > I'm puzzled It's pretty hard to read these details and not conclude that somebody has been manually manipulating that catalog. Missing rows might possibly be explained by index corruption ... but there is no scenario under which pg_database could have an OID different from 1262, nor could this change of attnums for the surviving rows ever have happened via Postgres-internal processes. I'm about ready to file this under "you broke it, you get to keep both pieces". regards, tom lane