github vibhorkum/pg_background v1.9
pg_background v1.9

latest release: v1.9.1
16 hours ago

⚠️ IMPORTANT: This release has critical crash bugs. Please use v1.9.1 instead.


New Features

Worker Labels

  • Optional label parameter on pg_background_launch_v2() and pg_background_submit_v2()
  • Labels visible in pg_background_list_v2() output
  • Helps identify workers in monitoring and debugging scenarios
  • Maximum 64 bytes

Structured Error Returns

  • New pg_background_error_info_v2(pid, cookie) function
  • Returns pg_background_error type with:
    • sqlstate - SQLSTATE error code (e.g., '23505')
    • message - Primary error message
    • detail - Detailed error info
    • hint - Hint for resolution
    • context - Error context/stack trace
  • Enables programmatic error handling without consuming results

Result Metadata

  • New pg_background_result_info_v2(pid, cookie) function
  • Returns pg_background_result_info type with:
    • row_count - Number of rows affected/returned
    • command_tag - SQL command executed (SELECT, INSERT, etc.)
    • completed - Whether execution finished
    • has_error - Whether an error occurred
  • Non-destructive inspection (doesn't consume results)

Batch Operations

  • pg_background_detach_all_v2() - Detach all tracked workers
  • pg_background_cancel_all_v2() - Cancel all tracked workers
  • Returns count of affected workers
  • Respects privilege model (only affects workers you launched)

PostgreSQL Compatibility

  • Tested on PostgreSQL 14, 15, 16, 17, 18
  • CI matrix covers Ubuntu 22.04 and 24.04

Installation

-- Fresh install
CREATE EXTENSION pg_background;

-- Upgrade from 1.8
ALTER EXTENSION pg_background UPDATE TO '1.9';

Don't miss a new pg_background release

NewReleases is sending notifications on new releases.