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

DESCRIPTION

10       This module implements a PostgreSQL specific bayesian storage module.
11
12       It subclasses Mail::SpamAssassin::BayesStore::SQL and overrides any
13       methods which makes SQL calls involving the token column.  Since
14       PostgreSQL uses BYTEA for the token column type you must make sure that
15       the DBD driver does the proper quoting.  You can accomplish this by
16       binding the token column to a specific type.
17
18       In versions 8.3 and up, synchronous_commit is disabled for faster
19       performance.  Data is not guaranteed to be stored until (3 *
20       wal_writer_delay) (default: 0.6s) after it is written. This tradeoff
21       works for Bayes because we care about aggregate data and a small period
22       of time can be lost without sacrificing accuracy.
23

METHODS

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

Private Methods

117   _connect_db
118       private instance (Boolean) _connect_db ()
119
120       Description: This method connects to the SQL database.
121
122   _put_token
123       private instance (Boolean) _put_token (string $token,
124                                              integer $spam_count,
125                                              integer $ham_count,
126                                  string $atime)
127
128       Description: This method performs the work of either inserting or
129       updating a token in the database.
130
131   _put_tokens
132       private instance (Boolean) _put_tokens (\% $token,
133                                               integer $spam_count,
134                                               integer $ham_count,
135                             string $atime)
136
137       Description: This method performs the work of either inserting or
138       updating tokens in the database.
139
140   _token_select_string
141       private instance (String) _token_select_string
142
143       Description: This method returns the string to be used in SELECT
144       statements to represent the token column.
145
146
147
148perl v5.34.0                      2021-M0a7i-l2:3:SpamAssassin::BayesStore::PgSQL(3)
Impressum