pgCompare can now run as a daemon server that polls a work queue for jobs. This enables:
- Multi-server deployment: Run multiple pgCompare instances that automatically pick up work
- Work queue scheduling: Submit compare, check, or discover jobs via the UI or external tools
- Job control signals: Pause, resume, stop, or terminate running jobs gracefully
- Real-time progress tracking: Monitor job progress at the table level
# Start pgCompare in server mode
java -jar pgcompare.jar server --name my-server-01
# Server mode only requires repository connection info in properties file
# Source/target database connections are loaded from project configuration-n|--name <server name>: Set the server name (default: pgcompare-server)
- Real-time server status monitoring with heartbeat tracking
- Running, pending, and completed job overview
- Quick access to job details and progress
- Schedule compare, check, or discover jobs from the UI
- Target specific servers or let any available server pick up work
- Set job priority (1-10) for queue ordering
- Optional scheduled start time for deferred execution
- Real-time job progress with per-table status
- Pause: Temporarily halt a running job (preserves progress)
- Resume: Continue a paused job
- Stop: Gracefully stop a job (completes current table)
- Terminate: Immediately stop a job
- Search/filter projects and tables in the navigation tree
- Breadcrumb navigation component
- Connection status indicator with auto-refresh
- Bulk operations for enabling/disabling multiple tables
- Export data to CSV or JSON format
- Pagination for large result sets
- Toast notifications replace browser alerts
- Loading skeletons for better perceived performance
- Keyboard shortcuts support
pgCompare now properly handles OS signals for clean shutdown and query cancellation:
- SIGINT (Ctrl+C): Graceful shutdown - completes the current table comparison before exiting
- SIGTERM: Immediate termination - cancels all running database queries and exits
- SIGHUP: Reload configuration from properties file without restart
Active database statements are tracked and can be cancelled on demand, preventing orphaned queries on the source/target databases during forced shutdowns.
Note: Drop and recreate the repository to upgrade to 0.6.0.
New tables for server mode:
dc_server: Server registration and heartbeat trackingdc_work_queue: Job queue with priority schedulingdc_job_control: Control signals for running jobsdc_job_progress: Per-table progress tracking
New REST API endpoints:
GET /api/servers: List registered serversGET /api/jobs: List jobs with filteringPOST /api/jobs: Submit a new jobGET /api/jobs/{id}: Get job detailsDELETE /api/jobs/{id}: Delete a completed/failed jobPOST /api/jobs/{id}/control: Send control signal (pause/resume/stop/terminate)GET /api/jobs/{id}/progress: Get job progress with per-table statusGET /api/health: Check database connection status
Server mode only requires repository connection properties:
repo-host=localhost
repo-port=5432
repo-dbname=pgcompare
repo-schema=pgcompare
repo-user=postgres
repo-password=secretProject-specific source/target database settings are loaded from the dc_project.project_config column.
- Stop all running pgCompare instances
- Backup your current repository database
- Drop the existing pgCompare schema:
DROP SCHEMA pgcompare CASCADE; - Run
java -jar pgcompare.jar initto create the new schema - Reconfigure your projects and table mappings
- Server mode requires PostgreSQL 14+ for
SKIP LOCKEDsupport - Job control signals may have up to 5 second delay before processing
- Servers are marked offline after 2 minutes without heartbeat