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

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