pgmemcache
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pgmemcache | 2.3.0 | SIM | MIT | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 9410 | pgmemcache | No | Yes | No | Yes | No | Yes | - |
PGDG packages remain absent for PG14 on EL8 aarch64.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PGDG | 2.3.0 | 1817161514 | pgmemcache | - |
| RPM | PGDG | 2.3.0 | 1817161514 | pgmemcache_$v | - |
| DEB | PGDG | 2.3.0 | 1817161514 | postgresql-$v-pgmemcache | - |
Install
You can install pgmemcache directly. First, make sure the PGDG repository is added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
Sources:
pgmemcache provides PostgreSQL user-defined functions for interacting with memcached servers.
Enabling
Configure default servers in postgresql.conf:
Server Management
Setting and Getting Values
Atomic Counters
Deleting and Flushing
Statistics
Trigger Example
Invalidate cache on table updates:
Configuration and Failure Boundaries
The library needs a reachable memcached service plus libmemcached or OMcache. The configured preload path requires a PostgreSQL restart. Server lists added with memcache_server_add belong to the current backend; arrange initialization for each new connection when not using configured defaults.
pgmemcache.flush_on_commit can flush buffered requests on commit. With buffered requests, set-related calls may return NULL because the final result is not yet known; this differs from memcache_get returning NULL for a missing key. Cache operations are external effects and database rollback does not undo already-sent changes. Do not use memcached as the authoritative durable copy.
memcache_flush_all() removes data from all configured cache servers. Restrict function grants and network access, especially where cache keys or values contain credentials.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)