For communication with Redis (and all other noSQL systems) uses PostgreSQL so called “foreign data wrappers”. There are two for Redis. From my point of view better is rw_redis_fdw.

Installation on Ubuntu:

  1. Install PostgreSQL
  2. If missing install postgresql-server-dev-x.x package
  3. if missing install libhiredis-dev package
  4. Download and unzip rw_redis_fdw archive
  5. Use “make” and “make install” commands from README file – BUT both must be launched under “sudo”!
  6. Create extension redis_fdw in PostgreSQL and use examples from README file to create foreign server, user mapping and basic objects.

Multiple hash object is “read-only” but this is not a problem. Just use multiple insert into “hash” object with the same key like this:

insert into redis_hash (key, field, value) values
('config:mylist:0', 'name', 'some name'),
('config:mylist:0', 'value1', 0),
('config:mylist:0', 'description', 'Any' ),
('config:mylist:0', 'myflag', false);