1Apache::Session::Store:U:sPeorstCgornetsr(i3b)uted PerlADpoaccuhmee:n:tSaetsisoinon::Store::Postgres(3)
2
3
4
6 Apache::Session::Store::Postgres - Store persistent data in a Postgres
7 database
8
10 use Apache::Session::Store::Postgres;
11
12 my $store = new Apache::Session::Store::Postgres;
13
14 $store->insert($ref);
15 $store->update($ref);
16 $store->materialize($ref);
17 $store->remove($ref);
18
20 Apache::Session::Store::Postgres fulfills the storage interface of
21 Apache::Session. Session data is stored in a Postgres database.
22
24 To use this module, you will need at least these columns in a table
25 called 'sessions', or another name if you supply the TableName
26 parameter.
27
28 id char(32) # or however long your session IDs are.
29 a_session text # This has an ~8 KB limit :(
30
31 To create this schema, you can execute this command using the psql
32 program:
33
34 CREATE TABLE sessions (
35 id char(32) not null primary key,
36 a_session text
37 );
38
39 If you use some other command, ensure that there is a unique index on
40 the table's id column.
41
43 The module must know what datasource, username, and password to use
44 when connecting to the database. These values can be set using the
45 options hash (see Apache::Session documentation). The options are:
46
47 DataSource
48 UserName
49 Password
50 Handle
51 TableName
52
53 Example:
54
55 tie %hash, 'Apache::Session::Postgres', $id, {
56 DataSource => 'dbi:Pg:dbname=database',
57 UserName => 'database_user',
58 Password => 'K00l'
59 };
60
61 Instead, you may pass in an already-opened DBI handle to your database.
62
63 tie %hash, 'Apache::Session::Postgres', $id, {
64 Handle => $dbh
65 };
66
68 This modules was written by Jeffrey William Baker <jwbaker@acm.org>
69
70 A fix for the commit policy was contributed by Michael Schout
71 <mschout@gkg.net>
72
74 Apache::Session, Apache::Session::Store::DBI
75
76
77
78perl v5.32.0 2020-09-19Apache::Session::Store::Postgres(3)