Some fixes for PostgreSQL and introduce pruning of the ringbuffer of moderated spots