вопрос по установке патчей custom_signal и runtime_explain
slavadba opened this issue · 4 comments
Добрый день.
не могли бы вы привести краткую инструкцию по установке патчей? или какую-нибудь ссылку где можно найти как правильно это делать?
попробовал создать сразу новый кластер с патчами:
1 ) в папке с распакованным дистрибутивом постгреса создал директорию patches в которую положил два файла с патчами
2 )
./configure
make
su
make install
но при установке расширения получаю ошибку:
postgres@student:~/pg_query_state$ make install USE_PGXS=1
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -fPIC -I. -I./ -I/usr/local/pgsql/include/server -I/usr/local/pgsql/include/internal -D_GNU_SOURCE -c -o pg_query_state.o pg_query_state.c
pg_query_state.c:67:44: error: ‘INVALID_PROCSIGNAL’ undeclared here (not in a function)
67 | static ProcSignalReason UserIdPollReason = INVALID_PROCSIGNAL;
| ^~~~~~~~~~~~~~~~~~
pg_query_state.c: In function ‘_PG_init’:
pg_query_state.c:203:21: warning: implicit declaration of function ‘RegisterCustomProcSignalHandler’ [-Wimplicit-function-declaration]
203 | UserIdPollReason = RegisterCustomProcSignalHandler(SendCurrentUserId);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [<builtin>: pg_query_state.o] Error 1
postgres@student:~/pg_query_state$
Добрый день.
В папке с распакованным дистрибутивом для каждого из патчей необходимо выполнить команду
git apply путь до патча
Если я правильно понимаю вашу структуру проекта, это будут команды
git apply patches/runtime_explain_VERSION.patch
git apply patches/custom_signals_VERSION.patch
После успешного выполнения команд, потребуется ещё раз сделать make и make install.
на патче runtime_explain_13.0.patch получаю ошибку:
student:~/postgresql-13.6$ git apply patches/custom_signals_13.0.patch
student:~/postgresql-13.6$ git apply patches/runtime_explain_13.0.patch
error: corrupt patch at line 6
student:~/postgresql-13.6$ git --version
git version 2.25.1
student:~/postgresql-13.6$
В таком случае, вместо git apply лучше использовать patch -p1 < имя файла
patch -p1 < patches/runtime_explain_13.0.patch
спасибо, так все получилось.