Skip to content

Commit 3b9bc32

Browse files
committed
Update PostgreSQLEnhanced to v1.7.3
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 #1 and #2
1 parent dbfcdfa commit 3b9bc32

8 files changed

Lines changed: 612 additions & 498 deletions

File tree

PostgreSQLEnhanced/MANIFEST

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ schema_columns.py
1010
schema_migrations.py
1111
undo_postgresql.py
1212
README.md
13+
INSTALL.md
14+
CHANGELOG.md

PostgreSQLEnhanced/README.md

Lines changed: 40 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22

33
A high-performance PostgreSQL database backend for Gramps genealogy software that provides advanced database capabilities and superior performance for genealogical data management while maintaining full compatibility with the Gramps data model.
44

5-
**Version:** 1.5.1
5+
**Version:** 1.6.0
66
**Project Status:** Experimental - Rigorous testing completed | [GitHub Repository](https://github.com/glamberson/gramps-postgresql-enhanced) | [Submit Issues](https://github.com/glamberson/gramps-postgresql-enhanced/issues)
77

88
## Recent Updates
99

10+
### Version 1.6.0 (2025-12-19)
11+
- **Gramps 6.0.6 compatibility** - Added required json_extract_expression() method
12+
- **Import guard** - Prevents registration when psycopg not available
13+
- **Performance index** - Added person_name_composite index for faster name searches
14+
- **Better error messages** - Clear guidance when dependencies missing
15+
1016
### Version 1.5.1 (2025-08-11)
1117
- **Fixed VARCHAR(255) truncation issue** - All string fields now use TEXT type to match SQLite behavior
1218
- **Automatic migration** - Existing databases are automatically upgraded when opened
@@ -22,9 +28,9 @@ The PostgreSQL Enhanced addon provides a professional-grade database backend for
2228

2329
- **Modern psycopg3** - Uses the latest PostgreSQL adapter (psycopg 3, not psycopg2)
2430
- **Dual Storage Format** - Maintains both pickle blobs (for Gramps compatibility) and JSONB (for advanced queries)
25-
- **Two Database Modes** - Both fully tested and working:
26-
- **Monolithic Mode** - All family trees in one database with table prefixes
27-
- **Separate Mode** - Each family tree gets its own PostgreSQL database
31+
- **Two Backend Options** - Select mode at tree creation:
32+
- **Monolithic** - All family trees in one database with table prefixes (recommended)
33+
- **Separate** - Each family tree gets its own PostgreSQL database
2834
- **Full Gramps Compatibility** - Works with all existing Gramps tools and reports
2935
- **Transaction Safety** - Proper savepoint handling and rollback capabilities
3036
- **Data Preservation** - Intelligent design that preserves data when trees are removed from Gramps
@@ -197,76 +203,83 @@ Create or edit `connection_info.txt` with the following format:
197203

198204
```ini
199205
# PostgreSQL Enhanced Connection Configuration
200-
# This file controls how the addon connects to PostgreSQL
201206

202207
# Connection details
203-
host = 192.168.10.90 # PostgreSQL server address
208+
host = localhost # PostgreSQL server address
204209
port = 5432 # PostgreSQL port
205210
user = genealogy_user # Database username
206211
password = YourPassword # Database password
207212

208-
# Database mode: 'separate' or 'monolithic'
209-
database_mode = monolithic
210-
211-
# For monolithic mode only: name of the shared database
212-
shared_database_name = gramps_monolithic
213+
# For Monolithic mode: name of the shared database
214+
shared_database_name = gramps_shared
213215

214-
# Optional settings (uncomment to use)
216+
# Optional settings
215217
# pool_size = 10 # Connection pool size
216218
# sslmode = prefer # SSL connection mode
217-
# connect_timeout = 10 # Connection timeout in seconds
218219
```
219220

220-
### Database Modes - Both Fully Tested and Working
221+
**Note**: Mode selection (Monolithic vs Separate) is now done by choosing the backend in the tree creation dialog, not in this file.
222+
223+
### Database Modes
224+
225+
**Mode selection is now part of backend choice** - you pick the mode when creating a tree.
221226

222-
#### Monolithic Mode
227+
#### Monolithic Mode (Recommended)
228+
229+
**Select**: "PostgreSQL Enhanced (Monolithic)" in backend dropdown
223230

224231
- **How it works**: All family trees share one PostgreSQL database
225232
- **Table naming**: Each tree's tables are prefixed with `tree_<treeid>_`
226233
- **Example**: Tree "68932301" creates tables like `tree_68932301_person`
227-
- **Configuration**: Uses central `connection_info.txt` in plugin directory
228234
- **Advantages**:
229235
- Single database to manage and backup
230236
- Can query across multiple trees
231237
- Works without CREATEDB privilege
232238
- Simplified administration
233-
- **Best for**: Organizations managing multiple related trees
239+
- **Best for**: Most users, organizations managing multiple related trees
240+
241+
#### Separate Mode (Advanced)
234242

235-
#### Separate Mode
243+
**Select**: "PostgreSQL Enhanced (Separate)" in backend dropdown
236244

237245
- **How it works**: Each family tree gets its own PostgreSQL database
238246
- **Database naming**: Creates database named after the tree ID
239247
- **Table naming**: Direct names without prefixes
240-
- **Configuration**: Uses central `connection_info.txt` in plugin directory
241248
- **Advantages**:
242249
- Complete isolation between trees
243250
- Simpler table structure
244251
- Per-tree backup/restore
245252
- Better for multi-user scenarios
246253
- Independent database tuning per tree
247-
- Lightning fast
248254
- **Best for**: Large independent trees or multi-tenant environments
255+
- **Requires**: PostgreSQL user with CREATEDB privilege
249256

250257
## Creating a Family Tree
251258

252259
### Step 1: Configure the Connection
253260

254-
Before creating a tree, ensure your `connection_info.txt` is properly configured:
261+
Ensure your `connection_info.txt` is configured in the plugin directory:
255262

256263
```bash
257264
# Edit the configuration file
258265
nano ~/.local/share/gramps/gramps60/plugins/PostgreSQLEnhanced/connection_info.txt
259266
```
260267

268+
Set at minimum: host, port, user, password, and shared_database_name (for Monolithic mode)
269+
261270
### Step 2: Create Tree in Gramps
262271

263272
1. Open Gramps
264273
2. Go to **Family Trees → Manage Family Trees**
265274
3. Click **New**
266275
4. Enter a name for your tree
267-
5. For **Database backend**, select "PostgreSQL Enhanced"
276+
5. For **Database backend**, select:
277+
- **PostgreSQL Enhanced (Monolithic)** - Recommended: shared database
278+
- **PostgreSQL Enhanced (Separate)** - Advanced: individual databases
268279
6. Click **Load Family Tree**
269280

281+
**The mode you select determines how your tree is stored.** No additional configuration needed.
282+
270283
### What Happens Behind the Scenes
271284

272285
When you create a new tree:
@@ -302,12 +315,13 @@ After registration, restart Gramps and the tree will appear in the Family Tree M
302315

303316
### Switching Between Modes
304317

305-
To switch from monolithic to separate mode (or vice versa):
318+
To switch a tree from one mode to another:
306319

307320
1. Export your tree as GEDCOM or Gramps XML
308-
2. Edit `connection_info.txt` to change `database_mode`
309-
3. Create a new tree in Gramps
310-
4. Import your exported data
321+
2. Create a new tree selecting the desired backend:
322+
- PostgreSQL Enhanced (Monolithic), or
323+
- PostgreSQL Enhanced (Separate)
324+
3. Import your exported data
311325

312326
## Design Features
313327

0 commit comments

Comments
 (0)