From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mariel Cherkassky <mariel.cherkassky@gmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: sequence depends on many tables
Date: Sun, 29 Sep 2019 11:32:23 -0400
Message-ID: <1796.1569771143@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+t6e1muOmnvyU7AzgCAx2RK1-8+YkKh5eo-csZETh1GGazbog@mail.gmail.com>
References: <CA+t6e1=UVWcQfn+am-P+_KgpuRk94+uNZkeAgfOvyDXJfU4ELA@mail.gmail.com>
<ce274899b8ebd7a49a2d6b9b1e73f141a32e0b4c.camel@cybertec.at>
<CA+t6e1nQnM2WuxCVEN5ykUC2PEH8FB1=n7ck1jQTx+wZ8+QTEA@mail.gmail.com>
<ca1a646620f69b3571462316f5757cdb5d577084.camel@cybertec.at>
<CA+t6e1muOmnvyU7AzgCAx2RK1-8+YkKh5eo-csZETh1GGazbog@mail.gmail.com>
Mariel Cherkassky <mariel.cherkassky@gmail.com> writes:
> seq_oid | classid | objid | objsubid | refclassid | refobjid | refobjsubid
> | deptype
> ---------+---------+-------+----------+------------+----------+-------------+---------
> 17188 | 1259 | 17188 | 0 | 1259 | 17190 | 1
> | a
> 16566 | 2604 | 16566 | 0 | 1259 | 17190 | 1
> | a
> 16704 | 2606 | 16704 | 0 | 1259 | 17190 | 3
> | a
> 16704 | 2606 | 16704 | 0 | 1259 | 17190 | 5
> | a
> 16704 | 2606 | 16704 | 0 | 1259 | 17190 | 4
> | a
> (5 rows)
Well, those entries with objid = 16566 and 16704 are not for sequences,
because the classid is wrong: 2604 is pg_attrdef, and 2606 is
pg_constraint, so the second row is for a default expression belonging
to table 17190 column 1, and the rest are for some kind of constraint
involving columns 3,4,5 (maybe a check constraint?)
In itself there's nothing wrong with these pg_depend entries, but it
is odd that you have different objects with identical OIDs. Normally
I'd only expect that to be possible once the OID counter has wrapped
around ... but all these OIDs are small, which makes it seem unlikely
that you've consumed enough OIDs to reach wraparound. Maybe you had
a system crash, or did something weird with backup/recovery, causing
the counter to get reset?
Anyway, the short answer here is that neither objid nor refobjid
should be considered sufficient to identify an object by themselves.
You need to also check classid (refclassid), because OIDs are only
guaranteed unique within a given system catalog.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, mariel.cherkassky@gmail.com, laurenz.albe@cybertec.at, pgsql-performance@lists.postgresql.org
Subject: Re: sequence depends on many tables
In-Reply-To: <1796.1569771143@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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