[Tracker-discuss] [issue213] Searching for ``patch`` creates a recursion limit traceback

Martin v. Löwis metatracker at psf.upfronthosting.co.za
Sun Jul 13 01:06:40 CEST 2008


Martin v. Löwis <martin at v.loewis.de> added the comment:

> It has a title "Templating Error" and wonder if SQL result is stored in memory
> before output? In this case is it possible to modify templating engine to allow
> streaming content directly from DB query?

That's not the problem at all. If you look at the true exception, you'll
notice

    self.db.cursor.execute(sql, tuple([int(row[0]) for row in r]))
ProgrammingError: ERROR:  stack depth limit exceeded
HINT:  Increase the configuration parameter "max_stack_depth".

This is a true error from postgres, and has nothing to do with the
template engine (and whether it's computing the result in memory).
Apparently, Postgres cannot properly support an "in" clause with
a large enumeration of literal values.

It shows up as a templating error, because the query is (indirectly)
invoked in the template, and because of the postgres exception, the
template cannot be rendered.

As I said, I worked around it by increasing postgresql's
max_stack_depth, from 2MB (which it was) to 7MB (which is the
recommended 1M less than `ulimit -s`). As I also said, this part
of SQL usage should probably be rewritten.

----------
title: Searching for ``patch`` creates a recursion limit traceback -> Searching for ``patch`` creates a	recursion limit traceback

_______________________________________________________
PSF Meta Tracker <metatracker at psf.upfronthosting.co.za>
<http://psf.upfronthosting.co.za/roundup/meta/issue213>
_______________________________________________________


More information about the Tracker-discuss mailing list