Michiel Lange <michiel@minas.demon.nl> writes:
> it is pretty strange... might it be a bug?
I'm quite sure it's a bug in your code. Try turning on query logging so
you can see what queries are being issued; maybe that will help solve
the problem.
regards, tom lane