Re: Bootstrap DATA is a pita - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bootstrap DATA is a pita
Date
Msg-id 32726.1424536449@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bootstrap DATA is a pita  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: Bootstrap DATA is a pita  (Andres Freund <andres@2ndquadrant.com>)
Re: Bootstrap DATA is a pita  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
> On 2015-02-20 22:19:54 -0500, Peter Eisentraut wrote:
>> On 2/20/15 8:46 PM, Josh Berkus wrote:
>>> Or what about just doing CSV?

>> I don't think that would actually address the problems.  It would just
>> be the same format as now with different delimiters.

> Yea, we need hierarchies and named keys.

Yeah.  One thought though is that I don't think we need the "data" layer
in your proposal; that is, I'd flatten the representation to something
more like
    { oid => 2249, oiddefine => 'CSTRINGOID', typname => 'cstring',        typlen => -2,        typbyval => 1,
...   }
 

This will be easier to edit, either manually or programmatically I think.
The code that turns it into a .bki file will need to know the exact set
of columns in each system catalog, but it would have had to know that
anyway I believe, if you're expecting it to insert default values.

Ideally the column defaults could come from BKI_ macros in the catalog/*.h
files; it would be good if we could keep those files as the One Source of
Truth for catalog schema info, even as we split out the initial data.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: deparsing utility commands
Next
From: Andres Freund
Date:
Subject: Re: Bootstrap DATA is a pita