Re: Using a single standalone-backend run in initdb (was Re: [HACKERS] Bootstrap DATA is a pita)

2015-12-17 Thread Tom Lane
Mark Dilger writes: > I use CREATE RULE within startup files in the fork that I maintain. I have > lots of them, totaling perhaps 50k lines of rule code. I don't think any of > that > code would have a problem with the double-newline separation you propose, > which seems a more elegant solution

Re: Using a single standalone-backend run in initdb (was Re: [HACKERS] Bootstrap DATA is a pita)

2015-12-13 Thread Tom Lane
Craig Ringer writes: > On 13 December 2015 at 06:31, Tom Lane wrote: >> I'm not particularly wedded to this rule. In principle we could go so >> far as to import psql's code that parses commands and figures out which >> semicolons are command terminators --- but that is a pretty large chunk >> o

Re: Using a single standalone-backend run in initdb (was Re: [HACKERS] Bootstrap DATA is a pita)

2015-12-13 Thread Mark Dilger
> On Dec 12, 2015, at 9:40 PM, Tom Lane wrote: > > Mark Dilger writes: >>> On Dec 12, 2015, at 3:42 PM, Tom Lane wrote: >>> ... In general, though, I'd rather not try to >>> teach InteractiveBackend() such a large amount about SQL syntax. > >> I use CREATE RULE within startup files in the for

Re: Using a single standalone-backend run in initdb (was Re: [HACKERS] Bootstrap DATA is a pita)

2015-12-13 Thread Craig Ringer
On 13 December 2015 at 06:31, Tom Lane wrote: > I'm not particularly wedded to this rule. In principle we could go so > far as to import psql's code that parses commands and figures out which > semicolons are command terminators --- but that is a pretty large chunk > of code, and I think it'd r

Re: Using a single standalone-backend run in initdb (was Re: [HACKERS] Bootstrap DATA is a pita)

2015-12-12 Thread Tom Lane
Mark Dilger writes: >> On Dec 12, 2015, at 3:42 PM, Tom Lane wrote: >> ... In general, though, I'd rather not try to >> teach InteractiveBackend() such a large amount about SQL syntax. > I use CREATE RULE within startup files in the fork that I maintain. I have > lots of them, totaling perhaps

Re: Using a single standalone-backend run in initdb (was Re: [HACKERS] Bootstrap DATA is a pita)

2015-12-12 Thread Mark Dilger
> On Dec 12, 2015, at 3:42 PM, Tom Lane wrote: > > Joe Conway writes: >> On 12/12/2015 02:31 PM, Tom Lane wrote: >>> I'm not particularly wedded to this rule. In principle we could go so >>> far as to import psql's code that parses commands and figures out which >>> semicolons are command term

Re: Using a single standalone-backend run in initdb (was Re: [HACKERS] Bootstrap DATA is a pita)

2015-12-12 Thread Tom Lane
Andres Freund writes: > That's cool too. Besides processing the .bki files, and there largely > reg*_in, the many restarts are the most expensive parts of initdb. BTW, in case anyone is doubting it, I did a little bit of "perf" tracing and confirmed Andres' comment here: more than 50% of the runt

Re: Using a single standalone-backend run in initdb (was Re: [HACKERS] Bootstrap DATA is a pita)

2015-12-12 Thread Tom Lane
Joe Conway writes: > On 12/12/2015 02:31 PM, Tom Lane wrote: >> I'm not particularly wedded to this rule. In principle we could go so >> far as to import psql's code that parses commands and figures out which >> semicolons are command terminators --- but that is a pretty large chunk >> of code, a

Re: Using a single standalone-backend run in initdb (was Re: [HACKERS] Bootstrap DATA is a pita)

2015-12-12 Thread Tom Lane
Andres Freund writes: > On 2015-12-12 17:31:49 -0500, Tom Lane wrote: >> Does anyone know of people using standalone mode other than >> for initdb? > Unfortunately yes. There's docker instances around that configure users > and everything using it. Hm, that means that we *do* have to worry about

Re: Using a single standalone-backend run in initdb (was Re: [HACKERS] Bootstrap DATA is a pita)

2015-12-12 Thread Joe Conway
On 12/12/2015 02:31 PM, Tom Lane wrote: > I'm not particularly wedded to this rule. In principle we could go so > far as to import psql's code that parses commands and figures out which > semicolons are command terminators --- but that is a pretty large chunk > of code, and I think it'd really be

Re: Using a single standalone-backend run in initdb (was Re: [HACKERS] Bootstrap DATA is a pita)

2015-12-12 Thread Andres Freund
On 2015-12-12 17:31:49 -0500, Tom Lane wrote: > I thought this sounded like a nice lazy-Saturday project, so I started > poking at it, and attached is a WIP patch. Not bad, not bad at all. > After some experimentation, I came up with the idea of executing any > time that a semicolon followed by

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-12 Thread Andres Freund
On 2015-12-12 13:28:28 -0500, Tom Lane wrote: > BTW, there's another thing I'd like to see improved in this area, which is > a problem already but will get a lot worse if we push more work into the > post-bootstrap phase of initdb. That is that the post-bootstrap phase is > both inefficient and im

Using a single standalone-backend run in initdb (was Re: [HACKERS] Bootstrap DATA is a pita)

2015-12-12 Thread Tom Lane
I wrote: > BTW, there's another thing I'd like to see improved in this area, which is > a problem already but will get a lot worse if we push more work into the > post-bootstrap phase of initdb. That is that the post-bootstrap phase is > both inefficient and impossible to debug. If you've ever ha

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-12 Thread Tom Lane
Mark Dilger writes: >> On Dec 11, 2015, at 2:54 PM, Caleb Welton wrote: >> Compare: >> CREATE FUNCTION lo_export(oid, text) RETURNS integer LANGUAGE internal >> STRICT AS 'lo_export' WITH (OID=765); >> >> DATA(insert OID = 765 ( lo_export PGNSP PGUID 12 1 0 0 0 f f f >> f t f v

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Mark Dilger
> On Dec 11, 2015, at 2:54 PM, Caleb Welton wrote: > > The current semantic level is pretty low level, somewhat cumbersome, and > requires filling in values that most of the time the system has a pretty good > idea how to fill in default values. > > Compare: > CREATE FUNCTION lo_export(oid, t

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Tom Lane
Andres Freund writes: > On 2015-12-11 19:26:38 -0500, Tom Lane wrote: >> I believe it's soluble, but it's going to take something more like >> loading up all the data at once and then doing lookups as we write >> out the .bki entries for each catalog. Fortunately, the volume of >> bootstrap data

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Andres Freund
On 2015-12-11 19:26:38 -0500, Tom Lane wrote: > I believe it's soluble, but it's going to take something more like > loading up all the data at once and then doing lookups as we write > out the .bki entries for each catalog. Fortunately, the volume of > bootstrap data is small enough that that won

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Tom Lane
Mark Dilger writes: > Now, if we know that pg_type.dat will be processed before pg_proc.dat, > we can replace all the Oids representing datatypes in pg_proc.dat with the > names for those types, given that we already have a name <=> oid > mapping for types. I don't think this is quite as simple a

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Andres Freund
On 2015-12-11 18:12:16 -0500, Tom Lane wrote: > I think what Mark is proposing is to do the lookups while preparing the > .bki file, which would eliminate the circularity ... at the cost of having > to, essentially, reimplement regprocedure_in and friends in Perl. FWIW, I did that, when this came

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Mark Dilger
> On Dec 11, 2015, at 3:02 PM, Tom Lane wrote: > > Mark Dilger writes: >>> On Dec 11, 2015, at 2:40 PM, Tom Lane wrote: >>> Huh? Those files are the definition of that mapping, no? Isn't what >>> you're proposing circular? > >> No, there are far more references to Oids than there are defini

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Tom Lane
Caleb Welton writes: > ... but there is some circularity especially with respect to type > definitions and the functions that define those types. If you changed the > definition of prorettype into a regtype then bootstrap would try to lookup > the type before the pg_type entry exists and throw a

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Tom Lane
Mark Dilger writes: >> On Dec 11, 2015, at 2:40 PM, Tom Lane wrote: >> Huh? Those files are the definition of that mapping, no? Isn't what >> you're proposing circular? > No, there are far more references to Oids than there are definitions of them. Well, you're still not being very clear, but

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Caleb Welton
Yes, that alone without any other changes would be a marked improvement and could be implemented in many places, pg_operator is a good example. ... but there is some circularity especially with respect to type definitions and the functions that define those types. If you changed the definition of

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Caleb Welton
The current semantic level is pretty low level, somewhat cumbersome, and requires filling in values that most of the time the system has a pretty good idea how to fill in default values. Compare: CREATE FUNCTION lo_export(oid, text) RETURNS integer LANGUAGE internal STRICT AS 'lo_export' WITH (OI

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Mark Dilger
> On Dec 11, 2015, at 2:40 PM, Tom Lane wrote: > > Mark Dilger writes: >>> On Dec 11, 2015, at 1:46 PM, Tom Lane wrote: >>> That's an interesting proposal. It would mean that the catalog files >>> stay at more or less their current semantic level (direct representations >>> of bootstrap catal

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Caleb Welton
I took a look at a few of the most recent bulk edit cases for pg_proc.h: There were two this year: * The addition of proparallel [1] * The addition of protransform [2] And prior to that the most recent seems to be from 2012: * The addition of proleakproof [3] Quick TLDR - the changes needed to

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Tom Lane
Mark Dilger writes: >> On Dec 11, 2015, at 1:46 PM, Tom Lane wrote: >> That's an interesting proposal. It would mean that the catalog files >> stay at more or less their current semantic level (direct representations >> of bootstrap catalog contents), but it does sound like a more attractive >>

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Mark Dilger
> On Dec 11, 2015, at 1:46 PM, Tom Lane wrote: > > Alvaro Herrera writes: >> Crazy idea: we could just have a CSV file which can be loaded into a >> table for mass changes using regular DDL commands, then dumped back from >> there into the file. We already know how to do these things, using >>

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Tom Lane
Alvaro Herrera writes: > Crazy idea: we could just have a CSV file which can be loaded into a > table for mass changes using regular DDL commands, then dumped back from > there into the file. We already know how to do these things, using > \copy etc. Since CSV uses one line per entry, there woul

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Caleb Welton
Makes sense. During my own prototyping what I did was generate the sql statements via sql querying the existing catalog. Way easier than hand writing 1000+ function definitions and not difficult to modify for future changes. As affirmed that it was very easy to adapt my existing sql to acco

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Alvaro Herrera
Caleb Welton wrote: > I'm happy working these ideas forward if there is interest. > > Basic design proposal is: > - keep a minimal amount of bootstrap to avoid intrusive changes to core > components > - Add capabilities of creating objects with specific OIDs via DDL during > initdb > - Updat

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-11 Thread Caleb Welton
I'm happy working these ideas forward if there is interest. Basic design proposal is: - keep a minimal amount of bootstrap to avoid intrusive changes to core components - Add capabilities of creating objects with specific OIDs via DDL during initdb - Update the caching/resolution mechanism f

Re: [HACKERS] Bootstrap DATA is a pita

2015-12-10 Thread Caleb Welton
Hello Hackers, Reviving an old thread on simplifying the bootstrap process. I'm a developer from the GPDB / HAWQ side of the world where we did some work a while back to enable catalog definition via SQL files and we have found it valuable from a dev perspective. The mechanism currently in t

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-09 Thread Andres Freund
On 2015-03-07 18:09:36 -0600, Jim Nasby wrote: > How often does a normal user actually initdb? I don't think it's that > incredibly common. Added time to our development cycle certainly is a > concern though. There's many shops that run initdb as part of their test/CI systems. Greetings, Andres

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-09 Thread Robert Haas
On Sun, Mar 8, 2015 at 12:35 PM, Andres Freund wrote: > On 2015-03-04 10:25:58 -0500, Robert Haas wrote: >> Another advantage of this is that it would probably make git less >> likely to fumble a rebase. If there are lots of places in the file >> where we have the same 10 lines in a row with occa

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-08 Thread Andrew Dunstan
On 03/08/2015 10:11 PM, Alvaro Herrera wrote: Tom Lane wrote: Andres Freund writes: And even if it turns out to actually be bothersome, you can help yourself by passing -U 5/setting diff.context = 5 or something like that. Um. Good luck with getting every patch submitter to do that. Can we

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-08 Thread Alvaro Herrera
Tom Lane wrote: > Andres Freund writes: > > And even if it turns out to actually be bothersome, you can help > > yourself by passing -U 5/setting diff.context = 5 or something like > > that. > > Um. Good luck with getting every patch submitter to do that. Can we do it centrally somehow? -- Á

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-08 Thread Tom Lane
Stephen Frost writes: > * Andrew Dunstan (and...@dunslane.net) wrote: >> On 03/07/2015 05:46 PM, Andres Freund wrote: >>> On 2015-03-07 16:43:15 -0600, Jim Nasby wrote: Semi-related... if we put some special handling in some places for bootstrap mode, couldn't most catalog objects

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-08 Thread Tom Lane
Andres Freund writes: > On 2015-03-04 10:25:58 -0500, Robert Haas wrote: >> Another advantage of this is that it would probably make git less >> likely to fumble a rebase. If there are lots of places in the file >> where we have the same 10 lines in a row with occasional variations, >> rebasing a

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-08 Thread Andres Freund
On 2015-03-04 10:25:58 -0500, Robert Haas wrote: > Another advantage of this is that it would probably make git less > likely to fumble a rebase. If there are lots of places in the file > where we have the same 10 lines in a row with occasional variations, > rebasing a patch could easily pick the

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-07 Thread Jim Nasby
On 3/7/15 6:02 PM, Stephen Frost wrote: * Andrew Dunstan (and...@dunslane.net) wrote: On 03/07/2015 05:46 PM, Andres Freund wrote: On 2015-03-07 16:43:15 -0600, Jim Nasby wrote: Semi-related... if we put some special handling in some places for bootstrap mode, couldn't most catalog objects be

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-07 Thread Stephen Frost
* Andrew Dunstan (and...@dunslane.net) wrote: > On 03/07/2015 05:46 PM, Andres Freund wrote: > >On 2015-03-07 16:43:15 -0600, Jim Nasby wrote: > >>Semi-related... if we put some special handling in some places for bootstrap > >>mode, couldn't most catalog objects be created using SQL, once we got >

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-07 Thread Andrew Dunstan
On 03/07/2015 05:46 PM, Andres Freund wrote: On 2015-03-07 16:43:15 -0600, Jim Nasby wrote: Semi-related... if we put some special handling in some places for bootstrap mode, couldn't most catalog objects be created using SQL, once we got pg_class, pg_attributes and pg_type created? That would

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-07 Thread Andres Freund
On 2015-03-07 16:43:15 -0600, Jim Nasby wrote: > Semi-related... if we put some special handling in some places for bootstrap > mode, couldn't most catalog objects be created using SQL, once we got > pg_class, pg_attributes and pg_type created? That would theoretically allow > us to drive much more

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-07 Thread Jim Nasby
On 3/4/15 9:07 AM, Stephen Frost wrote: * Robert Haas (robertmh...@gmail.com) wrote: On Wed, Mar 4, 2015 at 9:42 AM, Tom Lane wrote: and make it harder to compare entries by grepping out some common substring. Could you give an example of the sort of thing you wish to do? On that angle, I

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-06 Thread Alvaro Herrera
Robert Haas wrote: > On Wed, Mar 4, 2015 at 2:27 PM, Alvaro Herrera > wrote: > > BTW one solution to the merge problem is to have unique separators for > > each entry. For instance, instead of > Speaking from entirely too much experience, that's not nearly enough. > git only needs 3 lines of c

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Robert Haas
On Wed, Mar 4, 2015 at 2:27 PM, Alvaro Herrera wrote: > Andrew Dunstan wrote: >> On 03/04/2015 09:51 AM, Robert Haas wrote: >> >On Wed, Mar 4, 2015 at 9:06 AM, Peter Eisentraut wrote: >> >>>and make it harder to compare entries by grepping out some common >> >>>substring. >> >>Could you give an e

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Peter Eisentraut
On 3/4/15 9:51 AM, Robert Haas wrote: > On Wed, Mar 4, 2015 at 9:06 AM, Peter Eisentraut wrote: >>> and make it harder to compare entries by grepping out some common >>> substring. >> >> Could you give an example of the sort of thing you wish to do? > > e.g. grep for a function name and check tha

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Alvaro Herrera
Andrew Dunstan wrote: > > On 03/04/2015 09:51 AM, Robert Haas wrote: > >On Wed, Mar 4, 2015 at 9:06 AM, Peter Eisentraut wrote: > >>>and make it harder to compare entries by grepping out some common > >>>substring. > >>Could you give an example of the sort of thing you wish to do? > >e.g. grep fo

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Tom Lane
Robert Haas writes: > Another advantage of this is that it would probably make git less > likely to fumble a rebase. If there are lots of places in the file > where we have the same 10 lines in a row with occasional variations, > rebasing a patch could easily pick the the wrong place to reapply t

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Robert Haas
On Wed, Mar 4, 2015 at 10:04 AM, Andrew Dunstan wrote: > Is it necessarily an all or nothing deal? > > Taking a previous example, we could have something like: > > { > oid => 2249, oiddefine => 'CSTRINGOID', typname => 'cstring', > typlen => -2, typbyval => 1, > ..

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Andres Freund
On 2015-03-04 09:55:01 -0500, Robert Haas wrote: > On Wed, Mar 4, 2015 at 9:42 AM, Tom Lane wrote: > I wonder if we should have a tool in our repository to help people > edit the file. So instead of going in there yourself and changing > things by hand, or writing your own script, you can do: >

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Andrew Dunstan
On 03/04/2015 09:51 AM, Robert Haas wrote: On Wed, Mar 4, 2015 at 9:06 AM, Peter Eisentraut wrote: and make it harder to compare entries by grepping out some common substring. Could you give an example of the sort of thing you wish to do? e.g. grep for a function name and check that all the

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: > On Wed, Mar 4, 2015 at 9:42 AM, Tom Lane wrote: > >>> and make it harder to compare entries by grepping out some common > >>> substring. > > > >> Could you give an example of the sort of thing you wish to do? > > > > On that angle, I'm dubious that a

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Andrew Dunstan
On 03/04/2015 09:42 AM, Tom Lane wrote: Peter Eisentraut writes: On 3/3/15 9:49 PM, Robert Haas wrote: Even this promises to vastly increase the number of lines in the file, I think lines are cheap. Columns are much harder to deal with. Yeah. pg_proc.h is already impossible to work with i

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Tom Lane
Robert Haas writes: > On Wed, Mar 4, 2015 at 9:06 AM, Peter Eisentraut wrote: >> Could you give an example of the sort of thing you wish to do? > e.g. grep for a function name and check that all the matches have the > same volatility. Well, grep is not going to work too well anymore, but extrac

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Robert Haas
On Wed, Mar 4, 2015 at 9:42 AM, Tom Lane wrote: >>> and make it harder to compare entries by grepping out some common >>> substring. > >> Could you give an example of the sort of thing you wish to do? > > On that angle, I'm dubious that a format that allows omission of fields is > going to be easy

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Robert Haas
On Wed, Mar 4, 2015 at 9:06 AM, Peter Eisentraut wrote: >> and make it harder to compare entries by grepping out some common >> substring. > > Could you give an example of the sort of thing you wish to do? e.g. grep for a function name and check that all the matches have the same volatility. --

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Tom Lane
Peter Eisentraut writes: > On 3/3/15 9:49 PM, Robert Haas wrote: >> Even this promises to vastly increase the number of lines in the file, > I think lines are cheap. Columns are much harder to deal with. Yeah. pg_proc.h is already impossible to work with in a standard 80-column window. I don'

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Peter Eisentraut
On 3/3/15 9:49 PM, Robert Haas wrote: >> 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 =

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Andres Freund
On 2015-03-04 08:47:44 -0500, Robert Haas wrote: > >> Even this promises to vastly increase the number of lines in the file, > >> and make it harder to compare entries by grepping out some common > >> substring. I agree that the current format is a pain in the tail, but > >> pg_proc.h is >5k lines

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Robert Haas
>> Even this promises to vastly increase the number of lines in the file, >> and make it harder to compare entries by grepping out some common >> substring. I agree that the current format is a pain in the tail, but >> pg_proc.h is >5k lines already. I don't want it to be 100k lines >> instead. >

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-04 Thread Andres Freund
On 2015-03-03 21:49:21 -0500, Robert Haas wrote: > On Sat, Feb 21, 2015 at 11:34 AM, Tom Lane wrote: > > Andres Freund 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

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-03 Thread Robert Haas
On Sat, Feb 21, 2015 at 11:34 AM, Tom Lane wrote: > Andres Freund 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

Re: [HACKERS] Bootstrap DATA is a pita

2015-03-02 Thread Greg Stark
On Sat, Feb 21, 2015 at 11:08 PM, Andres Freund wrote: > The changes in pg_proc.h are just to demonstrate that using names > instead of oids works. Fwiw I always thought it was strange how much of our bootstrap was done in a large static text file. Very little of it is actually needed for bootstr

Re: [HACKERS] Bootstrap DATA is a pita

2015-02-21 Thread Andres Freund
On 2015-02-21 17:43:09 +0100, Andres Freund wrote: > One thing I was considering was to do the regtype and regproc lookups > directly in the tool. That'd have two advantages: 1) it'd make it > possible to refer to typenames in pg_proc, 2) It'd be much faster. Right > now most of initdb's time is do

Re: [HACKERS] Bootstrap DATA is a pita

2015-02-21 Thread Andres Freund
On February 21, 2015 7:20:04 PM CET, Andrew Dunstan wrote: > >On 02/21/2015 11:43 AM, Tom Lane wrote: > >> { >> oid => 2249, >> oiddefine => 'CSTRINGOID', >> typname => 'cstring', >> typlen => -2, >> typbyval => 1, >> ... >> } > > >which

Re: [HACKERS] Bootstrap DATA is a pita

2015-02-21 Thread Andrew Dunstan
On 02/21/2015 11:43 AM, Tom Lane wrote: Andrew Dunstan writes: On 02/21/2015 09:39 AM, Andrew Dunstan wrote: Personally, I think I would prefer that we use JSON (and yes, there's a JSON::Tiny module, which definitely lives up to its name). For one thing, we've made a feature of supporting JSO

Re: [HACKERS] Bootstrap DATA is a pita

2015-02-21 Thread Andres Freund
On 2015-02-21 11:34:09 -0500, Tom Lane wrote: > Andres Freund 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

Re: [HACKERS] Bootstrap DATA is a pita

2015-02-21 Thread Tom Lane
Andrew Dunstan writes: > On 02/21/2015 09:39 AM, Andrew Dunstan wrote: >> Personally, I think I would prefer that we use JSON (and yes, there's >> a JSON::Tiny module, which definitely lives up to its name). >> For one thing, we've made a feature of supporting JSON, so arguably we >> should eat

Re: [HACKERS] Bootstrap DATA is a pita

2015-02-21 Thread Tom Lane
Andres Freund 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 ne

Re: [HACKERS] Bootstrap DATA is a pita

2015-02-21 Thread Andrew Dunstan
On 02/21/2015 09:39 AM, Andrew Dunstan wrote: On 02/21/2015 05:04 AM, Andres Freund wrote: Yes, that's a good point. I have zero desire to open-code a format though, I think that's a bad idea. We could say we just include Yaml::Tiny, that's what it's made for. Personally, I think I would

Re: [HACKERS] Bootstrap DATA is a pita

2015-02-21 Thread Andrew Dunstan
On 02/21/2015 05:04 AM, Andres Freund wrote: Yes, that's a good point. I have zero desire to open-code a format though, I think that's a bad idea. We could say we just include Yaml::Tiny, that's what it's made for. Personally, I think I would prefer that we use JSON (and yes, there's a JSO

Re: [HACKERS] Bootstrap DATA is a pita

2015-02-21 Thread Andres Freund
On 2015-02-20 22:19:54 -0500, Peter Eisentraut wrote: > On 2/20/15 8:46 PM, Josh Berkus wrote: > > What about YAML? That might have been added somewhat earlier. > > YAML isn't included in Perl, but there is > > Module::Build::YAML - Provides just enough YAML support so that > Module::Build works e

Re: [HACKERS] Bootstrap DATA is a pita

2015-02-20 Thread Petr Jelinek
On 21/02/15 04:22, Peter Eisentraut wrote: I violently support this proposal. Maybe something rougly like: # pg_type.data CatalogData( 'pg_type', [ { oid => 2249, data => {typname => 'cstring', typlen => -2, typbyval => 1, fake => '...'}, oiddefine =

Re: [HACKERS] Bootstrap DATA is a pita

2015-02-20 Thread Peter Eisentraut
I violently support this proposal. > Maybe something rougly like: > > # pg_type.data > CatalogData( > 'pg_type', > [ > { >oid => 2249, >data => {typname => 'cstring', typlen => -2, typbyval => 1, fake => > '...'}, >oiddefine => 'CSTRINGOID' > } > ] >

Re: [HACKERS] Bootstrap DATA is a pita

2015-02-20 Thread Peter Eisentraut
On 2/20/15 8:46 PM, Josh Berkus wrote: > What about YAML? That might have been added somewhat earlier. YAML isn't included in Perl, but there is Module::Build::YAML - Provides just enough YAML support so that Module::Build works even if YAML.pm is not installed which might work. > Or what abou

Re: [HACKERS] Bootstrap DATA is a pita

2015-02-20 Thread Josh Berkus
On 02/20/2015 03:41 PM, Andres Freund wrote: > What I think we should do is to add pg_.data files that contain > the actual data that are automatically parsed by Catalog.pm. Those > contain the rows in some to-be-decided format. I was considering using > json, but it turns out only perl 5.14 starte

[HACKERS] Bootstrap DATA is a pita

2015-02-20 Thread Andres Freund
Hi, I've been for a long while been rather annoyed about how cumbersome it is to add catalog rows using the bootstrap format. Especially pg_proc.h, pg_operator.h, pg_amop.h, pg_amproc.h and some more are really unwieldy. I think this needs to be improved. And while I'm not going to start working