Willem Buitendyk <willem@xxxxxxxxx> writes: > ERROR: SPI_connect failed: SPI_ERROR_CONNECT > CONTEXT: PL/pgSQL function "pop_tag_day_over" line 17 at FOR over > SELECT rows Hm, what PG version is this? And could we have a complete test case not just the function? (I don't feel like trying to reverse-engineer your tables and views...) regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend