Re: WIP: a way forward on bootstrap data
John Naylor <jcnaylor@gmail.com>
From: John Naylor <jcnaylor@gmail.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2018-04-05T14:49:28Z
Lists: pgsql-hackers
Attachments
- bootstrap-v13-delta-lookup-function.patch (text/x-patch) patch v13
On 4/5/18, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Here are the results of an evening's desultory hacking on v13. > > [numeric function oids with overloaded name] Thank you for the detailed review and for improving the function references (not to mention the type references I somehow left on the table). I was also not quite satisfied with just the regproc columns. > I did not like the hard-wired handling of proargtypes and proallargtypes > in genbki.pl; it hardly seems impossible that we'll want similar > conversions for other array-of-OID columns in future. After a bit of > thought, it seemed like we could allow > > oidvector proargtypes BKI_LOOKUP(pg_type); > > Oid proallargtypes[1] BKI_DEFAULT(_null_) BKI_LOOKUP(pg_type); > > and just teach genbki.pl that if a lookup rule is attached to > an oidvector or Oid[] column, it means to apply the rule to > each array element individually. I think that's a good idea. I went an extra step and extracted the common logic into a function (attached draft patch to be applied on top of yours). It treats all lookups as operating on arrays. The common case is that we pass a single-element array. That may seem awkward, but I think it's clear. The code is slimmer, and the lines now fit within 80 characters. > I also changed genbki.pl so that it'd warn about entries that aren't > recognized by the lookup rules. This seems like a good idea for > catching errors, such as (ahem) applying BKI_LOOKUP to a column > that isn't even an OID. Yikes, I must have fat-fingered that during the comment reformatting. Unrelated, I noticed my quoting of defaults that contain back-slashes was half-baked, so I'll include that fix in the next patchset. I'll put out a new one in a couple days, to give a chance for further review and discussion of the defaults. I didn't feel the need to respond to the other messages, but yours and Andres' points are well taken. -John Naylor
Commits
-
Clarify handling of special-case values in bootstrap catalog data.
- 45c6d75f8cd2 11.0 landed
-
Replace our traditional initial-catalog-data format with a better design.
- 372728b0d495 11.0 landed
-
Faster partition pruning
- 9fdb675fc5d2 11.0 cited
-
Minor cleanup in genbki.pl.
- 8d90b4d01a61 11.0 landed
-
Trivial adjustments in preparation for bootstrap data conversion.
- a351679c806e 11.0 landed
-
Remove hard-coded schema knowledge about pg_attribute from genbki.pl
- 49c784ece766 11.0 landed
-
Minor edits to catalog files and scripts
- 9373baa0f764 11.0 landed
-
Hide most variable-length fields from Form_pg_* structs
- 8137f2c32322 9.2.0 cited