-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
59 lines (44 loc) · 1.63 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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 <[email protected]>.
License
-------
See the LICENSE file for full license details.
Authors
-------
Daniel Gustafsson <[email protected]>
Siavash Ghorbani
William Tisäter