'Set an association.  This is implemented as a method because
REPLACE INTO is not supported by PostgreSQL (and is not
standard SQL).'

def db_set_assoc(self, server_url, handle, secret, issued, lifetime, assoc_type):

    result = self.db_get_assoc(server_url, handle)
    rows = self.cur.fetchall()
    if len(rows):
        return self.db_update_assoc(secret, issued, lifetime, assoc_type, server_url, handle)
    else:
        return self.db_new_assoc(server_url, handle, secret, issued, lifetime, assoc_type)
