1Mail::SpamAssassin::BayUesseSrtoCroen:t:rPigbSuQtLe(d3M)Paeirll::DSopcaummAesnstaastsiionn::BayesStore::PgSQL(3)
2
3
4

NAME

6       Mail::SpamAssassin::BayesStore::PgSQL - PostgreSQL Specific Bayesian
7       Storage Module Implementation
8

SYNOPSIS

DESCRIPTION

11       This module implementes a PostgresSQL specific bayesian storage module.
12
13       It subclasses Mail::SpamAssassin::BayesStore::SQL and overrides any
14       methods which makes SQL calls involving the token column.  Since Post‐
15       greSQL uses BYTEA for the token column type you must make sure that the
16       DBD driver does the proper quoting.  You can accomplish this by binding
17       the token column to a specific type.
18

METHODS

20       token_expiration
21
22       public instance (Integer, Integer,
23                        Integer, Integer) token_expiration(\% $opts,
24                                                           Integer $newdelta,
25                                                           @ @vars)
26
27       Description: This method performs the database specific expiration of
28       tokens based on the passed in $newdelta and @vars.
29
30       seen_put
31
32       public (Boolean) seen_put (string $msgid, char $flag)
33
34       Description: This method records $msgid as the type given by $flag.
35       $flag is one of two values 's' for spam and 'h' for ham.
36
37       seen_delete
38
39       public instance (Boolean) seen_delete (string $msgid)
40
41       Description: This method removes $msgid from the database.
42
43       set_last_expire
44
45       public instance (Boolean) set_last_expire (Integer $time)
46
47       Description: This method sets the last expire time.
48
49       set_running_expire_tok
50
51       public instance (String $time) set_running_expire_tok ()
52
53       Description: This method sets the time that an expire starts running.
54
55       remove_running_expire_tok
56
57       public instance (Boolean) remove_running_expire_tok ()
58
59       Description: This method removes the row in the database that indicates
60       that and expire is currently running.
61
62       tok_get
63
64       public instance (Integer, Integer, Integer) tok_get (String $token)
65
66       Description: This method retrieves a specificed token ($token) from the
67       database and returns it's spam_count, ham_count and last access time.
68
69       tok_get_all
70
71       public instance (\@) tok_get (@ $tokens)
72
73       Description: This method retrieves the specified tokens ($tokens) from
74       storage and returns an array ref of arrays spam count, ham acount and
75       last access time.
76
77       nspam_nham_change
78
79       public instance (Boolean) nspam_nham_change (Integer $num_spam,
80                                                    Integer $num_ham)
81
82       Description: This method updates the number of spam and the number of
83       ham in the database.
84
85       tok_touch
86
87       public instance (Boolean) tok_touch (String $token,
88                                            String $atime)
89
90       Description: This method updates the given tokens ($token) atime.
91
92       The assumption is that the token already exists in the database.
93
94       tok_touch_all
95
96       public instance (Boolean) tok_touch (\@ $tokens
97                                            String $atime)
98
99       Description: This method does a mass update of the given list of tokens
100       $tokens, if the existing token atime is < $atime.
101
102       The assumption is that the tokens already exist in the database.
103
104       We should never be touching more than N_SIGNIFICANT_TOKENS, so we can
105       make some assumptions about how to handle the data (ie no need to batch
106       like we do in tok_get_all)
107
108       cleanup
109
110       public instance (Boolean) cleanup ()
111
112       Description: This method peroms any cleanup necessary before moving
113       onto the next operation.
114
115       clear_database
116
117       public instance (Boolean) clear_database ()
118
119       Description: This method deletes all records for a particular user.
120
121       Callers should be aware that any errors returned by this method could
122       causes the database to be inconsistent for the given user.
123

Private Methods

125       _connect_db
126
127       private instance (Boolean) _connect_db ()
128
129       Description: This method connects to the SQL database.
130
131       _put_token
132
133       private instance (Boolean) _put_token (string $token,
134                                              integer $spam_count,
135                                              integer $ham_count,
136                                  string $atime)
137
138       Description: This method performs the work of either inserting or
139       updating a token in the database.
140
141       _put_tokens
142
143       private instance (Boolean) _put_tokens (\% $token,
144                                               integer $spam_count,
145                                               integer $ham_count,
146                             string $atime)
147
148       Description: This method performs the work of either inserting or
149       updating tokens in the database.
150
151       _token_select_string
152
153       private instance (String) _token_select_string
154
155       Description: This method returns the string to be used in SELECT state‐
156       ments to represent the token column.
157
158
159
160perl v5.8.8                       2008-M0a1i-l0:5:SpamAssassin::BayesStore::PgSQL(3)
Impressum