From: | Alexey Kondratov <a(dot)kondratov(at)postgrespro(dot)ru> |
---|---|
To: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Cc: | Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, x4mmm(at)yandex-team(dot)ru, vladimirlesk(at)yandex-team(dot)ru, dsarafan(at)yandex-team(dot)ru |
Subject: | Re: [Patch] pg_rewind: options to use restore_command from recovery.conf or command line |
Date: | 2018-12-26 14:11:34 |
Message-ID: | 8a8d3069-129e-18c4-aab9-707825eca365@postgrespro.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Greetings,
>>>
>>>> - Reusing the GUC parser is something I would avoid as well. Not
>>>> worth
>>>> the complexity.
>>> Yes, I don't like it either. I will try to make guc-file.l frontend
>>> safe.
>> Any success with that?
>
> I looked into it and found that currently guc-file.c is built as part
> of guc.c, so it seems to be even more complicated to unbound
> guc-file.c from backend. Thus, I have some plan of how to proceed with
> patch:
>
> 1) Add guc-file.h and build guc-file.c separately from guc.c
>
> 2) Put guc-file.l / guc-file.h into common/*
>
> 3) Isolate all backend specific calls in guc-file.l with #ifdef FRONTEND
>
> Though I am not sure that this work is worth doing against extra
> redundancy added by simply adding frontend-safe copy of guc-file.l
> lexer. If someone has any thoughts I would be glad to receive comments.
>
I have finally worked it out. Now there is a common version of
guc-file.l and guc-file.c is built separately from guc.c. I had to use a
limited number of #ifndef FRONTEND, mostly to replace erreport calls.
Also, ProcessConfigFile and ProcessConfigFileInternal have been moved
inside guc.c explicitly as being a backend specific. So for me this
solution looks much more concise and neat.
Please, find the new version of patch attached. Tap tests have been
updated as well in order to handle both command line and postgresql.conf
specified restore_command.
Regards
--
Alexey Kondratov
Postgres Professional https://www.postgrespro.com
Russian Postgres Company
Attachment | Content-Type | Size |
---|---|---|
0001-pg_rewind-options-to-use-restore_command-v2.0.patch | text/x-patch | 64.0 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | David Steele | 2018-12-26 14:45:55 | Re: Change pgarch_readyXlog() to return .history files first |
Previous Message | Fabien COELHO | 2018-12-26 13:37:51 | Re: Alternative to \copy in psql modelled after \g |