Life & fun · September 4, 2020
Pub/Sub with PostgreSQL under 40 lines of
How to use PostgreSQL's LISTEN/NOTIFY as a simple message queue with psycopg2 and asyncio - listen.py
Launched as “Pub/Sub with PostgreSQL under 40 lines of Python code”
Pub/Sub with PostgreSQL under 40 lines of launched on September 4, 2020 with 17 votes, #835 of 3,432 launches that month and more than 75% of that year's launches. The site was still online in September 2026, 6 years on.
In plain words
This is a Python implementation that demonstrates how to build a publish-subscribe messaging system using PostgreSQL in under 40 lines of code. It is for developers who need a lightweight pub/sub solution without external dependencies. The implementation showcases how PostgreSQL's built-in features can handle message queuing and subscription patterns, making it useful for those wanting to understand pub/sub mechanics or integrate simple messaging into Python applications that already use PostgreSQL.
written by AI from its launch page and website · 9 September 2026
Originality
31/100
Crowded field. 69% of products launched in 2020 entered a less crowded field.
crowded fieldone of a kind
The score compares the words of this launch with every earlier launch in the archive: the fewer close matches on launch day, the higher the score. It says how new the idea was, not how good the product is. Similar products counted on November 30, 2026. See the similar products →This week’s most original launches →
Forecast
87%
chance that this product’s website is still online in November 2031. Typical launch of 2020 gets 81%.
- 1 year · Nov 2027
- 98%
- typical 97%
- 3 years · Nov 2029
- 93%
- typical 89%
- 5 years · Nov 2031
- 87%
- typical 81%
- Pub/Sub with PostgreSQL under 40 lines of
- Typical launch of 2020
Launch signals stronger than 91% of the archiveweakest → strongest
Made on November 29, 2026, when the site was online, from what was public on launch day. It is not revised, and it is graded when the site is checked again. How the forecast works and how often it is right →
From the sources
Anyone knows why conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT) is important here? Not doubting that it is important. Because when I took the line out, the program didn't work. Just asking out of curiosity. psycopg2 is implemented according to PEP-249 (Python Database API Specification v2.0, "dbapi" for short), which states: Note that if the database supports an auto-commit feature, this must be initially off. So at every statement, a transaction is implicitly opened, but not committed, so whenever you want to finish the transaction, you have to explicitly COMMIT , unless you turn on "autocommit" mode ( Django does this by default , deviating from PEP 249 ), which…from gist.github.com
Does a similar job
free ones →all alternatives →
PgQueuer2024 · github.com · ▲376PgQueuer is a Python job queue that uses PostgreSQL for everything — queue storage, locking, notifications. No Redis, no RabbitMQ, no separate broker to operate. If your app already has Postgres, you already have the broker. After ~2 years and 26 minor releases, 1.0 ships today as the first stable release. Strict semver from here on. Thanks to everyone who contributed and left feedback!
HonkerApr 2026 · github.com · ▲327SQLite extension + bindings for Postgres NOTIFY/LISTEN semantics with durable queues, streams, pub/sub, and scheduler
- PSPeerdb Streams2024 · ▲177
PeerDB Streams enables change data capture from PostgreSQL databases using native logical decoding to replicate data changes to message queues including Kafka, Redpanda, and Google PubSub.
ElectricSQL, Postgres to SQLite active-active2023 · electric-sql.com · ▲617ElectricSQL is an open source sync layer that enables bidirectional data synchronization between Postgres databases and local SQLite instances, including in web browsers via WebAssembly.
An SQS Alternative on Postgres2024 · github.com · ▲241A lightweight message queue. Like AWS SQS and RSMQ but on Postgres.
Postgres.js2022 · github.com · ▲257Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare
More life & fun this month
the category →
Tiny SFO▲634A tiny, live SFO: real flights land, taxi to their gates and take off under the Bay
Life & fun · 7d ago · tinysfo.com
- Bbouncemarket▲432
a ball will fall. trade on where it lands.
Life & fun · 9d ago · bouncemarket.minhanhday.com


- ON
Twenty-three graphics card demos by 3dfx, NVIDIA and ATI from 1998 to 2006, running in the browser.
Life & fun · 11d ago · gpu-demo-gallery.pages.dev
Motionflare▲349Turn your website into a stunning launch video in minutes
Life & fun · 22d ago · motionflare.ai
Is Pub/Sub with PostgreSQL under 40 lines of yours? Feature it on the home page: $19, or free with the badge →
Source: Show HN post ↗
Launched alongside, September 2020
the whole month →

- LS
A free, open-source Linux sysadmin course designed for beginners aspiring to junior system administration roles.
Commerce · 2020

Notion Pack▲595All the freelance docs you need, as Notion templates.
Work · 2020 · supercreative.design
