Re: unused_oids script is broken with bsd sed
John Naylor <jcnaylor@gmail.com>
From: John Naylor <jcnaylor@gmail.com>
To: Stas Kelvich <s.kelvich@postgrespro.ru>
Cc: andreas@proxel.se, Tom Lane <tgl@sss.pgh.pa.us>, Andrew Dunstan <andrew.dunstan@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>,
David Fetter <david@fetter.org>
Date: 2018-04-25T19:09:47Z
Lists: pgsql-hackers
On 4/26/18, Stas Kelvich <s.kelvich@postgrespro.ru> wrote:
> New version is attached. I've put iterator into Catalog.pm to avoid
> copy-pasting
> it over two scripts. Also instead of greping through *.dat and *.h files
> I've
> used parsers provided in Catalog module. That way should be more
> sustainable
> to format changes.
>
> Anyone who wanted to help with scripts -- feel free to rewrite.
Looks pretty good. Some comments:
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.
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.
For this type of call:
+my @oids = @{ Catalog::FindAllOidsFromHeaders(@input_files) };
+foreach my $oid (@oids)
this style is used by other callers of the module:
+my $oids = Catalog::FindAllOidsFromHeaders(@input_files);
+foreach my $oid (@{ $oids })
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.
-John Naylor
Commits
-
Blindly try to fix MSVC build's use of genbki.pl and Gen_fmgrtab.pl.
- bad51a49a4c0 11.0 landed
-
Avoid overwriting unchanged output files in genbki.pl and Gen_fmgrtab.pl.
- 1f1cd9b5ddc6 11.0 landed
-
Rearrange makefile rules for running Gen_fmgrtab.pl.
- 9bf28f96c7eb 11.0 landed
-
Avoid parsing catalog data twice during BKI file construction.
- a0854f10722b 11.0 landed
-
Fix duplicate_oids and unused_oids so user needn't cd to catalog dir.
- dd4cc9d7069c 11.0 landed
-
Convert unused_oids and duplicate_oids to use Catalog.pm infrastructure.
- 5602265f770f 11.0 landed
-
Make Catalog.pm's representation of toast and index decls more abstract.
- 1eb3a09e93d2 11.0 landed