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

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: Using a single standalone-backend run in initdb (was Re: Bootstrap DATA is a pita)
Дата
Msg-id 566CA8B7.40009@joeconway.com
обсуждение исходный текст
Ответ на Using a single standalone-backend run in initdb (was Re: Bootstrap DATA is a pita)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Using a single standalone-backend run in initdb (was Re: Bootstrap DATA is a pita)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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 overkill considering that initdb
> deals only with fixed input scripts.  But if anyone has another simple
> rule for breaking SQL into commands, we can certainly discuss
> alternatives.

Possibly inadequate, but I wrote a get_one_query() function to grab one
statement at a time from a possibly multi-statement string and it isn't
all that many lines of code:
 https://github.com/jconway/pgsynck/blob/master/pgsynck.c

> Anyway, the attached patch tweaks postgres.c to follow that rule instead
> of slurp-to-EOF when -j is given.  I doubt that being non-backwards-
> compatible is a problem here; in fact, I'm tempted to rip out the -j
> switch altogether and just have standalone mode always parse input the
> same way.  Does anyone know of people using standalone mode other than
> for initdb?

sepgsql uses it for installation, but it does not appear to use -j
I'm not sure why it is required but at some point I'd like to dig into that.

Joe

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Using a single standalone-backend run in initdb (was Re: Bootstrap DATA is a pita)
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Error with index on unlogged table