Re: autogenerating headers & bki stuff

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: autogenerating headers & bki stuff
Date: 2009-07-21 23:58:37
Message-ID: 603c8f070907211658i5180f2ffh7f6ed4133abc10f6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 29, 2009 at 11:59 PM, Robert Haas<robertmhaas(at)gmail(dot)com> wrote:
> As some of you have probably gathered from a couple of recent patches
> that I've posted, I've been taking a look at the scripts we use to
> generate various derived files based on the catalog headers, and I
> think there's room for improvement.  First, as discussed on previous
> threads, it seems needlessly complex to have both perl and
> shell-script implementations of genbki and Gen_fmgrtab.   Second,
> there's a fair amount of duplicated data that could be auto-generated,
> but currently isn't.
>
> The attached patch merges all of the logic currently in genbki.sh and
> Gen_fmgrtab.{sh,pl} into a single script called gen_catalog.pl.  It
> then extends that logic to generate all of the Anum_* and Natts_*
> constants, as well as the Schema_pg_* declarations for the bootstrap
> tables.  (I don't see a clean, easy way to generate Schema_pg_index,
> since there are no DATA() lines for that table in pg_attribute.h; but
> the others are all straightforward.)  It also adds a fair amount of
> error checking to what we currently have in place.
>
> In order to avoid create a build-time dependency on Perl for
> non-Windows platforms, this patch makes all of the things generated by
> gen_catalog.pl into distprep targets.  This should be OK, since none
> of them depend on architecture or configuration.
>
> I have not made any attempt to fix the MSVC build to work with this,
> but there should be some stuff that can be simplified there as well
> (in particular, the Perl reimplementation of genbki).

Updated to CVS HEAD. Peter's commit of my related patch "pg_listener
attribute number #defines" introduced a minor conflict.

...Robert

Attachment Content-Type Size
gen_catalog-v2.patch text/x-diff 119.9 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Gierth 2009-07-22 00:06:42 Re: revised hstore patch
Previous Message Webb Sprague 2009-07-21 23:51:16 Re: Commitfest Code Sprint with PUGs