Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBLt3-0000Pu-1Y for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Apr 2018 14:59:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fBLt1-00056E-O6 for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Apr 2018 14:59:11 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBLt1-000564-At for pgsql-hackers@lists.postgresql.org; Wed, 25 Apr 2018 14:59:11 +0000 Received: from xvm-110-146.dc2.ghst.net ([46.226.110.146] helo=fetter.org) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fBLsw-0005aJ-IN for pgsql-hackers@postgresql.org; Wed, 25 Apr 2018 14:59:10 +0000 Received: by fetter.org (Postfix, from userid 1001) id 0583B41BF2; Wed, 25 Apr 2018 16:59:04 +0200 (CEST) Date: Wed, 25 Apr 2018 16:59:03 +0200 From: David Fetter To: John Naylor Cc: Stas Kelvich , Tom Lane , Andrew Dunstan , PostgreSQL Hackers Subject: Re: unused_oids script is broken with bsd sed Message-ID: <20180425145902.GT25709@fetter.org> References: <37D774E4-FE1F-437E-B3D2-593F314B7505@postgrespro.ru> <34a54c54-9132-1254-2bc3-d3489fb79728@2ndQuadrant.com> <4473.1524665917@sss.pgh.pa.us> <4DE444D1-DDE9-460F-AC2F-EB1B73D94A2D@postgrespro.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Apr 25, 2018 at 09:55:54PM +0700, John Naylor wrote: > On 4/25/18, Stas Kelvich wrote: > >> On 25 Apr 2018, at 17:18, Tom Lane 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', \@include_path, 'FirstBootstrapObjectId'); While we're improving things, there's not really a reason this program should need to be run from any particular spot. It can detect where it is and act on that information. Best, David. -- David Fetter http://fetter.org/ Phone: +1 415 235 3778 Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate