Re: assert pg_class.relnatts is consistent

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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 12:44:19
Message-ID: CA+HiwqFQ3Mn0xN5E0v59nQjhV4OjR0f_+t3CSPzShsJW+mYK7Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 14, 2020 at 6:47 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> On Fri, Feb 14, 2020 at 06:00:05PM +0900, Amit Langote wrote:
> > On Fri, Feb 14, 2020 at 2:58 PM Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
> > > On Fri, Feb 14, 2020 at 1:04 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > > > 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.
> >
> > I tried and think it works but not sure if that's good Perl
> > programming. See the attached.
>
> I quite like what you have here. Please note that this comment in
> genbki.pl is incorrect regarding relnatts (the last part could just be
> deleted):
> # Note: only bootstrap catalogs, ie those marked BKI_BOOTSTRAP, need to
> # have entries here. Be sure that the OIDs listed here match those given in
> # their CATALOG and BKI_ROWTYPE_OID macros, and that the relnatts values are
> # correct.

You're right, although this comment is in pg_class.dat.

Thanks,
Amit

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Arseny Sher 2020-02-14 13:34:28 Re: ERROR: subtransaction logged without previous top-level txn record
Previous Message Dmitry Dolgov 2020-02-14 12:38:25 Re: [HACKERS] [PATCH] Generic type subscripting