Re: unused_oids script is broken with bsd sed

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: John Naylor <jcnaylor(at)gmail(dot)com>, Stas Kelvich <s(dot)kelvich(at)postgrespro(dot)ru>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: unused_oids script is broken with bsd sed
Date: 2018-04-25 15:48:13
Message-ID: 25f3ae08-5347-bd63-7866-05c135fdcfa3@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04/25/2018 10:55 AM, John Naylor wrote:
> On 4/25/18, Stas Kelvich <s(dot)kelvich(at)postgrespro(dot)ru> wrote:
>>> On 25 Apr 2018, at 17:18, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> I think we should rewrite
>>> both of them to use the Catalog.pm infrastructure.
>> Okay, seems reasonable. I'll put shared code in Catalog.pm and
>> update patch.
> I don't think you need any new code in Catalog.pm, I believe the
> suggestion was just to use that module as a stable interface to the
> data. Looking at your patch, I'll mention that we have an idiom for
> extracting #define'd OID symbols, e.g.:
>
> my $FirstBootstrapObjectId = Catalog::FindDefinedSymbol(
> 'access/transam.h', \(at)include_path, 'FirstBootstrapObjectId');
>
> This is preferred over using awk, which would have its own portability
> issues (Windows for starters).
>
> While I'm thinking out loud, it might be worthwhile to patch genbki.pl
> for the duplicate test, since they're run at the same time anyway (see
> catalog/Makefile), and we've already read all the data.
>

The logic for getting the set of oids should be centralized, if not in
Catalog.pm then in a script which serves both for dup0licate_oids and
unused_oids.

Here is something I cobbled together for the latter approach. It could
probably improve by using Catalog::FindDefinedSymbol()

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
unused_oids.pl application/x-perl 1.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-04-25 16:35:16 Re: perltidy version
Previous Message Bruno Lavoie 2018-04-25 15:22:27 Failed rpm package signature checks with reposync