|
NAMEMail::SpamAssassin::BayesStore::PgSQL - PostgreSQL Specific Bayesian Storage Module ImplementationDESCRIPTIONThis module implements a PostgreSQL specific bayesian storage module.It subclasses Mail::SpamAssassin::BayesStore::SQL and overrides any methods which makes SQL calls involving the token column. Since PostgreSQL uses BYTEA for the token column type you must make sure that the DBD driver does the proper quoting. You can accomplish this by binding the token column to a specific type. In versions 8.3 and up, synchronous_commit is disabled for faster performance. Data is not guaranteed to be stored until (3 * wal_writer_delay) (default: 0.6s) after it is written. This tradeoff works for Bayes because we care about aggregate data and a small period of time can be lost without sacrificing accuracy. METHODStoken_expirationpublic instance (Integer, Integer, Integer, Integer) token_expiration(\% $opts, Integer $newdelta, @ @vars)Description: This method performs the database specific expiration of tokens based on the passed in $newdelta and @vars. seen_putpublic (Boolean) seen_put (string $msgid, char $flag)Description: This method records $msgid as the type given by $flag. $flag is one of two values 's' for spam and 'h' for ham. seen_deletepublic instance (Boolean) seen_delete (string $msgid)Description: This method removes $msgid from the database. set_last_expirepublic instance (Boolean) set_last_expire (Integer $time)Description: This method sets the last expire time. set_running_expire_tokpublic instance (String $time) set_running_expire_tok ()Description: This method sets the time that an expire starts running. remove_running_expire_tokpublic instance (Boolean) remove_running_expire_tok ()Description: This method removes the row in the database that indicates that and expire is currently running. tok_getpublic instance (Integer, Integer, Integer) tok_get (String $token)Description: This method retrieves a specified token ($token) from the database and returns it's spam_count, ham_count and last access time. tok_get_allpublic instance (\@) tok_get (@ $tokens)Description: This method retrieves the specified tokens ($tokens) from storage and returns an array ref of arrays spam count, ham count and last access time. nspam_nham_changepublic instance (Boolean) nspam_nham_change (Integer $num_spam, Integer $num_ham)Description: This method updates the number of spam and the number of ham in the database. tok_touchpublic instance (Boolean) tok_touch (String $token, String $atime)Description: This method updates the given tokens ($token) atime. The assumption is that the token already exists in the database. tok_touch_allpublic instance (Boolean) tok_touch (\@ $tokens String $atime)Description: This method does a mass update of the given list of tokens $tokens, if the existing token atime is < $atime. The assumption is that the tokens already exist in the database. We should never be touching more than N_SIGNIFICANT_TOKENS, so we can make some assumptions about how to handle the data (ie no need to batch like we do in tok_get_all) cleanuppublic instance (Boolean) cleanup ()Description: This method performs any cleanup necessary before moving onto the next operation. clear_databasepublic instance (Boolean) clear_database ()Description: This method deletes all records for a particular user. Callers should be aware that any errors returned by this method could causes the database to be inconsistent for the given user. Private Methods_connect_dbprivate instance (Boolean) _connect_db ()Description: This method connects to the SQL database. _put_tokenprivate instance (Boolean) _put_token (string $token, integer $spam_count, integer $ham_count, string $atime)Description: This method performs the work of either inserting or updating a token in the database. _put_tokensprivate instance (Boolean) _put_tokens (\% $token, integer $spam_count, integer $ham_count, string $atime)Description: This method performs the work of either inserting or updating tokens in the database. _token_select_stringprivate instance (String) _token_select_stringDescription: This method returns the string to be used in SELECT statements to represent the token column.
Visit the GSP FreeBSD Man Page Interface. |