You’re right that the timeout is the core issue, but I need to ask you to bear with me on the configuration approach.
Gramps has made changes to both their database and connection manager layers recently. I haven’t been actively working in the Gramps codebase for a while, and your hybrid environment variable approach bypasses the normal code paths. This makes it very difficult to diagnose where the timeout is actually occurring.
When you use PGHOST, PGPORT, etc., you’re mixing two configuration systems - the environment variables (which connection.py picks up directly) and the ConfigManager system (which Gramps now expects). This means I can’t be certain whether the failure is in my code or in how the two systems are interacting.
That said, I did just fix a connection leak bug that matches your symptoms exactly - connections not being cleaned up when initialization fails. This is now in PR 781.
To properly test this fix, I need you to remove the environment variables (PGHOST, PGPORT, PGUSER, POSTGRESQL_ENHANCED_MODE) and use Gramps Preferences instead. Go to Edit → Preferences → Database and set host: localhost, port: 5434, user: your_username.
Then download the fixed files from my repo - postgresqlenhanced.py and connection.py from https://raw.githubusercontent.com/glamberson/gramps-postgresql-enhanced/update-gramps-606-compatibility/ and replace them in C:\Users\Ulrich Demlehner\AppData\Roaming\gramps\gramps60\plugins\PostgreSQLEnhanced\
After that, try creating a tree with PostgreSQL Enhanced (Monolithic).
If it still times out with proper configuration, then I need the debug log from C:\Users\Ulrich Demlehner.gramps\postgresql_enhanced_debug.log
With a clean configuration, the debug log will clearly show which initialization step is hanging, and I can fix it. I know the environment variables got you further initially, but to properly diagnose and fix this issue, I need to see it working through the supported code paths. Please bear with me on this.
Thanks,
Greg







