Hi PgSQL Hackers, I am overseeing a few hundred/thousand postgres/pgagent installations and on one installation the pgAgent does not start with a message as a service on a Windows Server:
ERROR: Couldn't register event handle. once the service is being started. Investigation showed that this is not an issue of logging in as postgres, neither is this a connection issue to the postgres DB, see more details at https://dba.stackexchange.com/questions/207067/pgagent-does-not-start-with-message-error-couldnt-register-event-handle It seems to me that pgAgent tries and fails to write something to the windows logger . To confirm/reject this hypothesis I decided to download the sources of pgAgent adjust the code a bit, and see it for myself. This is what I did: (1) I installed MS Visual Studio 2017 Community (MSVS) (2) I downloaded wxWidgets, compiled it with the MSVS in UTF, Debugging and Release, win32 Settings (to F:\pgbuild\wxWidgets-3.1.1) (3) I downloaded, extracted, cmake-gui'ed pgAgent-3.4.0-Source into F:\pgbuild\pgAgent-3.4.0-Source (4) I download the 9.6 32bit postgres and extracted it into F:\pgbuild\pgsql (5) I adjusted pgAgent MSVS solution configuration to include F:\pgbuild\wxWidgets-3.1.1\lib\vc_lib\mswud and F:\pgbuild\pgsql\lib (6) F:\pgbuild has also libiconv, libxml2, libxslt (7) I am able to compile pgAgent to the point that the executable is created (that dies if I run it), other targets (ALL_BUILD, INSTALL, etc.) cannot be built successfully with the following error: 1>------ Build started: Project: run, Configuration: Debug Win32 ------ 1>Generating pgagent--3.4.sql, pgagent.control 1>CUSTOMBUILD : CMake error : Error processing file: cmake/MakeExt.cmake 1>Done building project "run.vcxproj" -- FAILED. 2>------ Skipped Build: Project: INSTALL, Configuration: Debug Win32 ------ 2>Project not selected to build for this solution configuration 3>------ Skipped Build: Project: PACKAGE, Configuration: Debug Win32 ------ 3>Project not selected to build for this solution configuration ========== Build: 0 succeeded, 1 failed, 4 up-to-date, 2 skipped ========== Questions: (1) How can I compile and debug PgAgent (i.e., address compilation issues)? (2) Any comments, how to get pgAgent running? Cheers, Arturas