Re: assert pg_class.relnatts is consistent

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: assert pg_class.relnatts is consistent
Date: 2020-02-14 05:58:37
Message-ID: CA+HiwqGit=b-VsEhEX_Mx_meJPvcuWN8mFMJrOkqPHLD+1rEtQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 14, 2020 at 1:04 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Amit Langote <amitlangote09(at)gmail(dot)com> writes:
> > On Thu, Feb 13, 2020 at 4:51 PM Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
> >> I know I have made the mistake of not updating relnatts when I added
> >> relispartition, etc. to pg_class, only to be bitten by it in the form
> >> of seemingly random errors/crashes. Is that why?
>
> > Sorry for not having read the patch properly.
> >> + /* Check that pg_class data is consistent now, rather than failing obscurely later */
> > That seems to be it.
>
> I've been burnt by this too :-(. However, I think this patch is
> completely the wrong way to go about improving this. What we should
> be doing, now that we have all that perl code generating postgres.bki,
> is eliminating the problem at the source. That is, drop the hand-coded
> relnatts values from pg_class.dat altogether, and let the perl code fill
> it in --- compare the handling of pg_proc.pronargs for instance.

I can't write Perl myself (maybe Justin), but +1 to this idea.

Thanks,
Amit

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-02-14 06:05:18 Re: LOCK TABLE and DROP TABLE on temp tables of other sessions
Previous Message Thomas Munro 2020-02-14 05:31:45 Re: Should we add xid_current() or a int8->xid cast?