Re: unused_oids script is broken with bsd sed

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: John Naylor <jcnaylor@gmail.com>
Cc: Stas Kelvich <s.kelvich@postgrespro.ru>, andreas@proxel.se, Andrew Dunstan <andrew.dunstan@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, David Fetter <david@fetter.org>
Date: 2018-04-25T20:08:03Z
Lists: pgsql-hackers
John Naylor <jcnaylor@gmail.com> writes:
> Just after you posted, I sent a patch that tweaks the API of
> Catalog.pm for toast and index oids. If you use that API in your
> patch, you can get rid of the extra bookkeeping you added for those
> oids.

I've adjusted these two patches to play together, and pushed them.

> The original scripts skipped the relation and rowtype oids for
> bootstrap catalogs. You've replaced that with two data-level tests for
> pg_class plus pg_type composite types. I think the original test was a
> bit cleaner in this regard.

Yeah, I thought so too.  Changed.

> For those following along, these scripts still assume we're in the
> catalog directory. I can hack on that part tomorrow if no one else
> has.

I didn't touch this point.

I notice that duplicate_oids is now a good factor of 10 slower than it was
before (~0.04 sec to ~0.4 sec, on my machine).  While this doesn't seem
like a problem for manual use, it seems annoying as part of the standard
build process, especially on slower buildfarm critters.  I think we should
do what you said upthread and teach genbki.pl to complain about duplicate
oids, so that we can remove duplicate_oids from the build process.

I went ahead and pushed things as-is so we can confirm that duplicate_oids
has no portability issues that the buildfarm could find.  But let's try
to get the build process change in place after a day or so.

			regards, tom lane


Commits

  1. Blindly try to fix MSVC build's use of genbki.pl and Gen_fmgrtab.pl.

  2. Avoid overwriting unchanged output files in genbki.pl and Gen_fmgrtab.pl.

  3. Rearrange makefile rules for running Gen_fmgrtab.pl.

  4. Avoid parsing catalog data twice during BKI file construction.

  5. Fix duplicate_oids and unused_oids so user needn't cd to catalog dir.

  6. Convert unused_oids and duplicate_oids to use Catalog.pm infrastructure.

  7. Make Catalog.pm's representation of toast and index decls more abstract.