redis
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_redis_pubsub | 0.0.1 | FDW | MIT | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 8720 | redis | No | Yes | No | Yes | No | Yes | - |
| Related | pgmq pgmb redis_fdw ulak pgq pgmqtt tcn pgmemcache pg_durable kafka_fdw |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.0.1 | 1817161514 | pg_redis_pubsub | - |
| RPM | PIGSTY | 0.0.1 | 1817161514 | pg_redis_pubsub_$v | - |
| DEB | PIGSTY | 0.0.1 | 1817161514 | postgresql-$v-pg-redis-pubsub | - |
Build
You can build the RPM / DEB packages for pg_redis_pubsub using pig build:
Install
You can install pg_redis_pubsub directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
redis: Send Redis pub/sub messages to Redis from PostgreSQL directly
The redis extension (pg_redis_pubsub) allows PostgreSQL to publish messages to Redis pub/sub channels. Currently, only the publish side is supported.
Configuration
Set the Redis connection parameters via GUC variables:
These can also be set at the database, role, or session level:
Basic Usage
Available Functions
| Function | Description |
|---|---|
redis_connect() | Connect to Redis using redis.host and redis.port settings |
redis_disconnect() | Disconnect from Redis |
redis_publish(channel text, message text) | Publish a message on the specified channel |
redis_status() | Return the status of the Redis client |
Note: redis_publish automatically connects if no connection exists.
Trigger Example
Publish change events to Redis whenever a table is modified:
This allows external subscribers listening on Redis channels to react to PostgreSQL data changes in real time.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)