https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7190

            Bug ID: 7190
           Summary: txrep_pg.sql is not Postgresql
           Product: Spamassassin
           Version: 3.4.1
          Hardware: Sun
                OS: Solaris
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Documentation
          Assignee: [email protected]
          Reporter: [email protected]

txrep_pg.sql is not compatible with postgresql

I used:


CREATE TABLE txrep (
  username varchar(100) NOT NULL default '',
  email varchar(255) NOT NULL default '',
  ip varchar(40) NOT NULL default '',
  count int NOT NULL default '0',
  totscore float NOT NULL default '0',
  signedby varchar(255) NOT NULL default '',
  last_hit timestamp NOT NULL default now(),
  PRIMARY KEY (username,email,signedby,ip)
);


CREATE OR REPLACE FUNCTION update_modified_timestamp()
RETURNS TRIGGER AS $$
BEGIN
    IF (NEW != OLD) THEN
        NEW.last_hit = CURRENT_TIMESTAMP;
        RETURN NEW;
    END IF;
    RETURN OLD;
END;
$$ LANGUAGE plpgsql;


CREATE TRIGGER txrep_last_hit_trigger BEFORE UPDATE
    ON txrep FOR EACH ROW EXECUTE PROCEDURE 
    update_modified_timestamp();



...but please have it checked by someone that specialises in postgresql.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to