Re: No xmin in pg_database

From: Alexander Kass <alexander(dot)kass(at)jetbrains(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: No xmin in pg_database
Date: 2021-09-08 13:20:44
Message-ID: CAPhX7d1Ew2Hry=2xTdrJVq0A_RpmqCVh3KCtuO+CfQP62L6Hrg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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:
+----+--------+--------+------+
|xmin|attrelid|attname |attnum|
+----+--------+--------+------+
|1 |1262 |tableoid|-6 |
|1 |1262 |cmax |-5 |
|1 |1262 |xmax |-4 |
|1 |1262 |cmin |-3 |
|1 |1262 |xmin |-2 |
|1 |1262 |ctid |-1 |
|1 |1262 |oid |1 |
|1 |1262 |datname |2 |
...

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

PS: I'm not familiar with mailing lists. Is it ok to attach images here?

On Thu, Sep 2, 2021 at 1:41 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> writes:
> > On Thu, 2021-09-02 at 08:50 +0300, Alexander Kass wrote:
> >> We have a small number of users that do not have xmin in pg_database
> >> (we've asked them to try `select xmin from pg_database` and got
> >> `column xmin does not exist`).
>
> > All PostgreSQL tables have "xmin", and all catalog tables do as well.
>
> Indeed. This seems to be evidence of corruption in the pg_attribute
> catalog. If you're really lucky, reindexing pg_attribute might fix
> it, though I wonder what other problems there are. (It's odd though
> that identical corruption would happen to different installations.)
>
> regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2021-09-08 13:45:36 Re: No xmin in pg_database
Previous Message Jehan-Guillaume de Rorthais 2021-09-08 06:39:03 Re: prevent WAL replication to fill filesystem