Re: Postgres perl module namespace

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Postgres perl module namespace
Дата
Msg-id f49c0f56-a215-1ea9-0268-dce85ca64226@dunslane.net
обсуждение исходный текст
Ответ на Re: Postgres perl module namespace  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Postgres perl module namespace  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On 2022-04-19 Tu 20:30, Michael Paquier wrote:
> On Tue, Apr 19, 2022 at 07:24:58PM -0400, Andrew Dunstan wrote:
>> On 2022-04-19 Tu 18:39, Michael Paquier wrote:
>>> +*generate_ascii_string = *TestLib::generate_ascii_string;
>>> +*slurp_dir = *TestLib::slurp_dir;
>>> +*slurp_file = *TestLib::slurp_file;
>>>
>>> I am not sure if it is possible and my perl-fu is limited in this
>>> area, but could a failure be enforced when loading this path if a new
>>> routine added in TestLib.pm is forgotten in this list?
>> Not very easily that I'm aware of, but maybe some superior perl wizard
>> will know better.
> Okay.  Please do not consider this as a blocker.  I was just wondering
> about ways to ease more the error reports when it comes to
> back-patching, and this would move the error stack a bit earlier.



There are a few other things that could make backpatching harder, and
while they are not related to the namespace issue they do affect a bit
how that is managed.


The following variables are missing in various versions of TestLib:


in version 13 and earlier: $is_msys2, $timeout_default

in version 12 and earlier: $use_unix_sockets


and the following functions are missing:


in version 14 and earlier: pump_until

in version 13 and earlier: dir_symlink

in version 11 and earlier: run_command

in version 10: check_mode_recursive, chmod_recursive,  check_pg_config


(Also in version 10 command_checks_all exists but isn't exported. I'm
inclined just to remedy that along the way)


Turning to PostgresNode, the class-wide function get_free_port is absent
from version 10, and the following instance methods are absent from some
or all of the back branches:

adjust_conf, clean_node, command_fails_like, config_data, connect_fails,
connect_ok, corrupt_page_checksum, group_access, installed_command,
install_path, interactive_psql, logrotate, set_recovery_mode,
set_standby_mode, wait_for_log

We don't export or provide aliases for any of these instance methods in
these patches, but attempts to use them in backpatched code will fail
where they are absent, so I thought it worth mentioning.


Basically I propose just to remove any mention of the Testlib items and
get_free_port from the export and alias lists for versions where they
are absent. If backpatchers need a function they can backport it if
necessary.


cheers


andrew


--
Andrew Dunstan
EDB: https://www.enterprisedb.com




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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: pg14 psql broke \d datname.nspname.relname
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Replace open mode with PG_BINARY_R/W/A macros