1min.

1MIN · DATABASES

PostgreSQL email extension queues messages until a transaction commits

pg_utl_smtp 2.0 adds an asynchronous mode to its Oracle-compatible email procedures for PostgreSQL. Instead of contacting SMTP during the transaction, it stores a completed message in a database queue and schedules a background job. The email is sent only if the transaction commits, avoiding notifications about rolled-back changes. Delivery failures move into queue status, so successful job execution alone does not prove a message was sent.

HexaCluster · Oct 6, 2026

Why it matters

External side effects need clear commit and failure semantics when they originate inside database transactions.

More context

This October 6 release was announced on PostgreSQL.org on October 18. It requires PostgreSQL 11 or newer, plperlu and Perl SMTP dependencies; asynchronous delivery also requires pg_dbms_job. Try commit, rollback and unavailable-server cases in staging, and monitor utl_smtp.mail_queue rather than only the job history.

Keep in mind

Failed sends are not automatically retried; the extension provides async_resend for resubmission. This is a migration-oriented extension with incomplete Oracle API coverage, not a complete mail service.

Original read

More engineering ideas, one minute at a time.

Explore more stories