--- ./src/zabbix_server/housekeeper/housekeeper.c.orig 2009-12-21 15:57:18.000000000 +0100 +++ ./src/zabbix_server/housekeeper/housekeeper.c.alt1 2009-12-21 15:58:06.000000000 +0100 @@ -68,8 +68,10 @@ static int housekeeping_process_log() housekeeper.field, housekeeper.value); #elif defined(HAVE_POSTGRESQL) - deleted = DBexecute("delete from %s where oid in (select oid from %s where %s=" ZBX_FS_UI64 " limit 500)", + deleted = DBexecute("delete from %s where %s=" ZBX_FS_UI64 " and oid in (select oid from %s where %s=" ZBX_FS_UI64 " limit 500)", housekeeper.tablename, + housekeeper.field, + housekeeper.value, housekeeper.tablename, housekeeper.field, housekeeper.value);