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-03-26T14:00:36Z
Lists: pgsql-hackers
On 3/25/18, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Well, as I said, I hadn't really reviewed the .dat files, but if that's > what you're doing I'm going to request a change. Project style is to > fit in 80 columns as much as possible. I do not see a reason to exempt > the .dat files from that, especially not since it would presumably be a > trivial change in rewrite_dat.pl to insert extra newlines between fields > when needed. (Obviously, if a field value is so wide it runs past 80 > columns on its own, it's not rewrite_dat.pl's charter to fix that.) This feature is working now. I've attached a 100-line sample of all the catalogs' files for viewing. Note, this is pretty raw output, without the clean-up step from patch 0002. In the most of the original DATA() lines, there was no spacing between entries except in some cases to separate groups (often with a comment to describe the group). My clean-up patch tried to make that more consistent. For this sample, it would add blank lines before the comments in pg_amop, and remove blank lines from the first few entries in pg_type. If you wanted to opine on that before I rework that patch, I'd be grateful. Also, these data entries have default values removed, but they don't have human-readable OID macros. (I'll have to adjust that script to the 80-column limit as well). >> -Arrange for rewrite_dat.pl to run when perltidy does. > > What I was thinking we should have is a convenience target in > include/Makefile to do this, say "make reformat-dat-files". > I'm not that excited about bundling it into pgindent runs. I've attached a draft patch for this. If it's okay, I'll incorporate it into the series. I think reformat_dat_files.pl also works as a better script name. >> -Maybe document examples of how to do bulk-editing of data files? > > +1. In the end, that's the reason we're doing all this work, so showing > people how to benefit seems like a good thing. It seems like with that, it'd be good to split off the data-format section of the README into a new file, maybe README.data, which will contain code snippets and some example scenarios. I'll include the example pg_proc.prokind merger among those. -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