A PostgreSQL API based to interface with redis.
C
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
Makefile
README
TODO
pgredis.c
pgredis.h
pgredis.sql.in

README

pgredis
=======
pgredis adds functionality to your PostgreSQL database to set and retrieve data from your Redis cache.
This project is very much a work in progress and this documentation is thus very incomplete, this is
due to change quite soon as the project progress.


Requirements
------------
* PostgreSQL with PGXS (8.4 and 9.0 tested)
* Redis with CRedis (libcredis installed)


Installation
------------
In order to use pgredis you need to build it from source and add it to either your database or for
all databases in your PostgreSQL server. Install pgredis by using the below steps:

1) make install
2) Add pgredis to your database using for a single database or the PostgreSQL server:
	2.1) Per database using psql: 
		BEGIN; 
		\i <path to pgredis.sql as shown in make install output>; 
		COMMIT;
		SELECT pr_set_servet('<hostname[:port]>');
	2.2) Per server in config: Add the following entries to your PostgreSQL configuration and 
	     restart your postmaster process:
		shared_preload_libraries = 'pgredis'
		custom_variable_classes = 'pgredis'
		pgredis.redis_server = <hostname[:port][:database]>


Usage
-----
pgredis expose an API based on stored procedures:

SELECT pr_set_server(<hostname[:port][:database]::TEXT>);
SELECT pr_select_db(<db::INTEGER>);
SELECT pr_set(<key::TEXT>, <value::TEXT>);
SELECT pr_set(<key::TEXT>, <value::TEXT>, <expire::INTEGER>);
SELECT pr_get(<key::TEXT>);


Feedback
--------
Please send bugreports, patches and other flammable material to <daniel@hobbit.se>.


License
-------
See the LICENSE file for full license details.


Authors
-------
Daniel Gustafsson <daniel@hobbit.se>
Siavash Ghorbani
William Tisäter