Slight refactoring of state check in pg_upgrade check_ function

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Slight refactoring of state check in pg_upgrade check_ function
Дата
Msg-id 595759F6-625B-4ED7-8125-91AF00437F83@yesql.se
обсуждение исходный текст
Ответы Re: Slight refactoring of state check in pg_upgrade check_ function  (Nathan Bossart <nathandbossart@gmail.com>)
Список pgsql-hackers
I noticed that the pg_upgrade check_ functions were determining failures found
in a few different ways.  Some keep a boolen flag variable, and some (like
check_for_incompatible_polymorphics) check the state of the script filehandle
which is guaranteed to be set (with the error message referring to the path of
said file).  Others like check_loadable_libraries only check the flag variable
and fclose the handle assuming it was opened.

The attached diff changes the functions to do it consistently in one way, by
checking the state of the filehandle.  Since we are referring to the file by
path in the printed error message it seemed the cleanest approach, and it saves
a few lines of code without IMO reducing readability.

There is no change in functionality, just code consistency.

--
Daniel Gustafsson        https://vmware.com/


Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [RFC] building postgres with meson - v12
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: replacing role-level NOINHERIT with a grant-level option