Forum OpenACS Development: Response to Is the QD involved when db call is in an included file?

This looks a lot like a usage that wasn't expected when the QD was written.

For the heck of it, try putting the query in the index-postgresql.xql file and see if it finds it.  I bet it does, proving your theory ...

This is evil and something Ben will have to fix in his QD code.