Release Notes
What's Changed
* apg vs. psy benchmark section by janbjorge in https://github.com/janbjorge/PgQueuer/pull/61
* Remove superfluous use of dsn func by janbjorge in https://github.com/janbjorge/PgQueuer/pull/62
* Update docker compose ci by janbjorge in https://github.com/janbjorge/PgQueuer/pull/64
* Use relative imports by janbjorge in https://github.com/janbjorge/PgQueuer/pull/66
* Entrypoint rate limit by janbjorge in https://github.com/janbjorge/PgQueuer/pull/65
Breaking Changes
**Important:** Before upgrading to this version, you must run the following command:
bash
python3 -m PgQueuer upgrade
Alternatively, you can manually update the trigger function before booting up the new version.
psql
CREATE OR REPLACE FUNCTION fn_pgqueuer_changed() RETURNS TRIGGER AS $$
DECLARE
to_emit BOOLEAN := false; -- Flag to decide whether to emit a notification
BEGIN
-- Check operation type and set the emit flag accordingly
IF TG_OP = 'UPDATE' AND OLD IS DISTINCT FROM NEW THEN
to_emit := true;
ELSIF TG_OP = 'DELETE' THEN
to_emit := true;
ELSIF TG_OP = 'INSERT' THEN
to_emit := true;
ELSIF TG_OP = 'TRUNCATE' THEN
to_emit := true;
END IF;
-- Perform notification if the emit flag is set
IF to_emit THEN
PERFORM pg_notify(
'ch_pgqueuer',
json_build_object(
'channel', 'ch_pgqueuer',
'operation', lower(TG_OP),
'sent_at', NOW(),
'table', TG_TABLE_NAME,
'type', 'table_changed_event'
)::text
);
END IF;
-- Return appropriate value based on the operation
IF TG_OP IN ('INSERT', 'UPDATE') THEN
RETURN NEW;
ELSIF TG_OP = 'DELETE' THEN
RETURN OLD;
ELSE
RETURN NULL; -- For TRUNCATE and other non-row-specific contexts
END IF;
END;
$$ LANGUAGE plpgsql;
**Full Changelog**: https://github.com/janbjorge/PgQueuer/compare/v0.5.7...v0.6.0