-- find backups without corresponding rows in backup_parts (database consistency check)
select hosts.name as host, shares.name as share, backups.num, backups.date::abstime, type, size, inc_size, inc_deleted, parts, dvd_nr
from backups
join hosts on hostid=hosts.id
join shares on shareid=shares.id
full outer join archive_backup on archive_backup.backup_id = backups.id
full outer join archive on archive.id = archive_backup.archive_id
where backups.id not in (select backup_id from backup_parts)
	and inc_deleted is false
	and size > 0
order by host,share,num
;
