]> git.8kb.co.uk Git - slony-i/user_replication/blob - README.md
Remove irrelevant grant
[slony-i/user_replication] / README.md
1 user_replication
2 ================
3
4 A basic table and trigger based user replication example for use
5 with PostgreSQL and Slony-I.
6
7 About
8 -----
9
10 This is something I created back in 2008 to easily keep users in sync 
11 across a slony cluster.
12
13 The supplied functions have various limitations, one of which is the "options" 
14 field only being useful for managing role membership, anything more complicated 
15 will most likely fail without further work.
16
17 It has the option to store the standard postgresql md5 encrypted passwords, or 
18 or allow unencrypted password retrieval via a PGP encryption using a symmetric-key
19 obfuscated during construction with a (rather horrible) c function named "hkey".
20
21 If you want to use the hkey obfuscation functionality see *Using the hkey obfuscation*
22 below.
23
24 To use execute the sql script on each node:
25
26     # psql -d <db> user_replication.sql
27
28 Now put the 'replicated_users' table into replication using slony and users
29 can be managed by the create_replicated_user etc functions.
30
31 SELECT create_replicated_user('superted', 'test', 'IN GROUP users');
32 SELECT detail_replicated_user('superted');
33 SELECT alter_replicated_user('superted', 'test', 'IN GROUP admins');
34 SELECT alter_replicated_user('superted', 'test', 'IN GROUP admins');
35
36 Using the hkey obfuscation
37 --------------------------
38
39     # cd hkey
40     # make
41     # make install
42     # /usr/local/pgsql/bin/psql -d <db> -U <user> < hkey.sql
43
44 Then alter "v_use_hkey := false" to "v_use_hkey := true" in both the
45 decrypt_replicated_users and encrypt_replicated_users functions. 
46 Note the pgcrypto contrib module is required for this.