#include "catalog/pg_collation.h"
#include "commands/defrem.h"
+#include "miscadmin.h"
#include "tsearch/ts_locale.h"
#include "tsearch/ts_public.h"
#include "tsearch/ts_type.h"
tmpprs->wanthost = true;
+ /*
+ * Check stack depth before recursing. (Since TParserGet() doesn't
+ * normally recurse, we put the cost of checking here not there.)
+ */
+ check_stack_depth();
+
if (TParserGet(tmpprs) && tmpprs->type == HOST)
{
prs->state->posbyte += tmpprs->lenbytetoken;
tmpprs->state = newTParserPosition(tmpprs->state);
tmpprs->state->state = TPS_InURLPathFirst;
+ /*
+ * Check stack depth before recursing. (Since TParserGet() doesn't
+ * normally recurse, we put the cost of checking here not there.)
+ */
+ check_stack_depth();
+
if (TParserGet(tmpprs) && tmpprs->type == URLPATH)
{
prs->state->posbyte += tmpprs->lenbytetoken;
{
const TParserStateActionItem *item = NULL;
+ CHECK_FOR_INTERRUPTS();
+
Assert(prs->state);
if (prs->state->posbyte >= prs->lenstr)