Re: Replace pg_controldata output fields with macros for better code manageability

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Replace pg_controldata output fields with macros for better code manageability
Дата
Msg-id d0b0fa85-4fe9-7d0c-c74c-18141bc8aab5@enterprisedb.com
обсуждение исходный текст
Ответ на Replace pg_controldata output fields with macros for better code manageability  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Список pgsql-hackers
On 29.01.22 15:30, Bharath Rupireddy wrote:
> While working on another pg_control patch, I observed that the
> pg_controldata output fields such as "Latest checkpoint's
> TimeLineID:", "Latest checkpoint's NextOID:'' and so on, are being
> used in pg_resetwal.c, pg_controldata.c and pg_upgrade/controldata.c.

The duplication between pg_resetwal and pg_controldata could probably be 
handled by refactoring the code so that only one place is responsible 
for printing it.  The usages in pg_upgrade are probably best guarded by 
tests that ensure that any changes anywhere else don't break things. 
Using macros like you suggest only protects against one kind of change: 
changing the wording of a line.  But it doesn't protect for example 
against a line being removed from the output.

While I'm sympathetic to the issue you describe, the proposed solution 
introduces a significant amount of ugliness for a problem that is really 
quite rare.




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

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Re: pg_receivewal - couple of improvements
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: psql - add SHOW_ALL_RESULTS option