Skip to content

Conversation

@glamberson
Copy link

Update PostgreSQLEnhanced to v1.7.3

Summary

Major update to PostgreSQLEnhanced addon with dual backend registration, ConfigManager integration, and Gramps 6.0.6 API compatibility.

Key Changes

Dual Backend Registration

  • PostgreSQL Enhanced (Monolithic) - All trees in shared database with table prefixes (recommended)
  • PostgreSQL Enhanced (Separate) - Individual database per tree (advanced users)

Mode selection now integrated into backend choice - users select the appropriate backend when creating a tree.

ConfigManager Integration

  • Per-tree settings.ini files following standard Gramps pattern
  • Inherits host/port from Edit → Preferences → Database
  • Password handled securely (prompted, not stored)
  • Backward compatible with connection_info.txt

Gramps 6.0.6 API Compatibility

  • Implemented json_extract_expression() method (required by DBAPI changes from Aug 2025)
  • Added person_name_composite index for improved performance
  • Compatible with Gramps commit ce25f3c01

Bug Fixes

  • Import guard prevents registration when psycopg unavailable
  • Fixed config file being ignored due to environment variable logic
  • Fixed database auto-creation in separate mode
  • Proper initialization of force_mode attribute

Migration for Existing Users

Two migration scripts provided in scripts/ directory:

  1. migrate_to_dual_backends.py - Updates backend IDs in database.txt
  2. migrate_to_settings_ini.py - Migrates connection_info.txt to settings.ini

Users upgrading from v1.5.2 should run both scripts.

Testing

  • Tested on Gramps 6.0.1 and 6.0.6
  • Both modes (Monolithic and Separate) verified working
  • Migration scripts tested on existing databases
  • ConfigManager integration validated

Documentation

  • Updated README.md with dual backend explanation
  • Added Windows AIO installation instructions
  • Added Flatpak installation instructions
  • Comprehensive troubleshooting section
  • CHANGELOG.md with complete version history

Breaking Changes

  • Backend IDs changed from postgresqlenhanced to postgresqlenhanced-monolithic and postgresqlenhanced-separate
  • Configuration migrated from connection_info.txt to per-tree settings.ini
  • Migration scripts handle transition automatically

Compatibility

  • Python 3.9+
  • Gramps 6.0+
  • PostgreSQL 15+
  • psycopg 3.1+

Related

@glamberson glamberson force-pushed the update-postgresql-enhanced-v1.7.0 branch from 3b9bc32 to b261307 Compare December 20, 2025 22:09
@glamberson
Copy link
Author

Hi, Could someone review this please? Thanks!

@glamberson glamberson force-pushed the update-postgresql-enhanced-v1.7.0 branch 2 times, most recently from 3fe53b9 to a2cd046 Compare December 21, 2025 16:08
Major update with dual backend registration and ConfigManager integration.

Changes:
- Dual backend registration: Monolithic and Separate modes
- ConfigManager integration for per-tree settings.ini
- Gramps 6.0.6 API compatibility (json_extract_expression, composite index)
- Import guard for psycopg dependency checking
- Bug fixes for config loading and database creation
- Migration scripts for existing users
- Documentation updates for Windows AIO and Flatpak

Breaking changes:
- Backend IDs changed to postgresqlenhanced-monolithic/separate
- Migration scripts provided in scripts/ directory
- Users must run migrate_to_dual_backends.py and migrate_to_settings_ini.py

Fixes GitHub issues gramps-project#1 and gramps-project#2
@glamberson glamberson force-pushed the update-postgresql-enhanced-v1.7.0 branch from a2cd046 to c6c4ba2 Compare December 21, 2025 17:35
@GaryGriffin
Copy link
Member

Are you satisfied with the review such that this is ready for merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No creation of a new tree possible PostgreSQL Enhanced plugin not working on Ubuntu 24.04 with Gramps Flatpak install.

3 participants