I worked with the client on this one via support case 01348346
The following were the steps we took to resolve it:
The initial install of Postgres failed - possibly because it was taking longer than expected:
'postgres installation has taken longer than expected. Assuming it as a hung process.'
The client did a manual uninstall deleting the Postgres directories and registry entries as there was no entry for it in the Control Panel/Add Remove Programs. However, it seems that there may have been other parts of the install still in place, causing a subsequent re-install to fail.
I noticed in the Postgres install log that the subsequent install failed to run the following script:
----------------------------------------
Configuring database server startup...
Executing cscript //NoLogo "C:\Program Files\CA APM\PostgreSQL-9.6.2\installer\server\startupcfg.vbs" 9.6 "postgres" "****" "C:\Program Files\CA APM\PostgreSQL-9.6.2" "C:\Program Files\CA APM\PostgreSQL-9.6.2\data" "pgsql-9.6"
Script exit code:
Script output:
Script stderr:
Unknown error while running cscript //NoLogo "C:\Program Files\CA APM\PostgreSQL-9.6.2\installer\server\startupcfg.vbs" 9.6 "postgres" "****" "C:\Program Files\CA APM\PostgreSQL-9.6.2" "C:\Program Files\CA APM\PostgreSQL-9.6.2\data" "pgsql-9.6"
----------------------------------------
I had them run the following from the command line on the server:
cscript //NoLogo "C:\Program Files\CA APM\PostgreSQL-9.6.2\installer\server\startupcfg.vbs" 9.6 "postgres" "****" "C:\Program Files\CA APM\PostgreSQL-9.6.2" "C:\Program Files\CA APM\PostgreSQL-9.6.2\data" "pgsql-9.6"
This ran and appeared to complete the Postgres install, including adding the entries in the Control Panel/Add Remove Programs.
They then ran an uninstall from the Control Panel and it seemed to do a complete uninstall of Postgres (filesystem, registry entries and any other components).
This then allowed for a full install of APM including the Postgres DB which ran successfully.