Re: Do we need use more meaningful variables to replace 0 in catalog head files?

From: Andres Freund <andres(at)anarazel(dot)de>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, Jan de Visser <jan(at)de-visser(dot)net>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Hao Lee <mixtrue(at)gmail(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Do we need use more meaningful variables to replace 0 in catalog head files?
Date: 2016-11-13 09:54:28
Message-ID: 20161113095428.6opeklh65owo5ix7@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2016-11-12 12:30:45 -0500, Andrew Dunstan wrote:
>
>
> On 11/11/2016 11:10 AM, Tom Lane wrote:
> > boolin: OID=1242 proname=boolin proargtypes="cstring" prorettype=bool
> > boolin: prosrc=boolin provolatile=i proparallel=s
> >
> >
>
>
> I have written a little perl script to turn the pg_proc DATA lines into
> something like the format suggested. In order to keep the space used as
> small as possible, I used a prefix based on the OID. See attached result.
>
> Still plenty of work to go, e.g. grabbing the DESCR lines, and turning this
> all back into DATA/DESCR lines, but I wanted to get this out there before
> going much further.
>
> The defaults I used are below (commented out keys are not defaulted, they
> are just there for completeness).

In the referenced thread I'd started to work on something like this,
until other people also said they'd be working on it. I chose a
different output format (plain Data::Dumper), but I'd added the parsing
of DATA/DESCR and such to genbki.

Note that I found that initdb performance is greatly increased *and*
legibility is improvided, if types and such in the data files are
expanded, and converted to their oids when creating postgres.bki.

I basically made genbki/catalog.pm accept text whenever a column is of
type regtype/regprocedure/. To then make use of that I converted a bunch
of plain oid columns to their their reg* equivalent. That's also nice
for just plain qureying of the catalogs ;)

I don't think the code is going to be much use for you directlky, but it
might be worthwhile to crib some stuff from the 0002 of the attached
patches (based on 74811c4050921959d54d42e2c15bb79f0e2c37f3).

Greetings,

Andres Freund

Attachment Content-Type Size
0001-Reduce-strength-of-assert-in-mdcreate-to-work-correc.patch text/x-patch 1.7 KB
0002-Do-much-more-stuff-in-genbki.pl.patch text/x-patch 73.9 KB
0003-example-conversion.patch text/x-patch 2.6 MB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Emre Hasegeli 2016-11-13 12:21:11 Re: Contains and is contained by operators of inet datatypes
Previous Message Andres Freund 2016-11-13 09:21:40 Re: Logical Replication WIP