Enums

JobPriority

class pg_scheduler.JobPriority(value)[source]

Bases: Enum

Job priority levels for scheduling.

Lower priority numbers indicate higher priority (jobs execute first). Jobs are processed in ascending priority order: 1 → 3 → 5 → 8.

CRITICAL = 'critical'
HIGH = 'high'
NORMAL = 'normal'
LOW = 'low'
property db_value: int

Get the database integer value for this priority level.

Returns:

Database priority value (1, 3, 5, or 8)

Return type:

int

Note

Lower numbers = higher priority. Used for ORDER BY in SQL queries.

classmethod from_db_value(db_value: int) JobPriority[source]

Convert a database integer value back to a JobPriority enum.

Parameters:

db_value – The integer priority value from the database (1, 3, 5, or 8)

Returns:

The corresponding priority enum member

Return type:

JobPriority

Note

If an unknown value is provided, defaults to NORMAL.

__str__() str[source]

String representation of the priority.

Returns:

The priority label (e.g., “critical”, “normal”)

Return type:

str

__repr__() str[source]

Developer-friendly representation of the priority.

Returns:

Detailed representation with name, label, and db_value

Return type:

str

ConflictResolution

class pg_scheduler.ConflictResolution(value)[source]

Bases: Enum

Strategies for handling duplicate job_id conflicts

RAISE = 'raise'
IGNORE = 'ignore'
REPLACE = 'replace'

VacuumTrigger

class pg_scheduler.VacuumTrigger(value)[source]

Bases: Enum

Vacuum policy trigger types

IMMEDIATE = 'immediate'
TIME_BASED = 'time_based'
COUNT_BASED = 'count_based'
NEVER = 'never'