1min.

1MIN · DATABASES

An asynchronous PostgreSQL mail extension sends only after commit

pg_utl_smtp 2.0 adds asynchronous email to its Oracle-style PostgreSQL SMTP interface. Instead of contacting the server inside the calling session, it stores a message in a queue and schedules a background job; sending happens only if the transaction commits. Delivery errors then belong to the queue’s status, not the original SQL caller. The new mode preserves application calls while changing their failure semantics.

HexaCluster · PostgreSQL.org · Oct 6, 2026

Why it matters

A committed database transaction and a delivered message are different events that need separate monitoring.

More context

Try the extension in a test database with PL/Perl, Net::SMTP and pg_dbms_job configured. Monitor mail_queue rather than treating a successful scheduler job as delivery. This is an older release: the October 18 announcement carries an October 6 release dateline.

Keep in mind

Failed asynchronous jobs are not automatically retried, and the queue is not automatically purged. Review permissions, retention and SMTP access before enabling it in production.

Original read

More engineering ideas, one minute at a time.

Explore more stories