Re: "out of balance" result on select from suspected index corruption [RESOLVED]

From: "Henry - Zen Search SA" <henry(at)zen(dot)co(dot)za>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: "out of balance" result on select from suspected index corruption [RESOLVED]
Date: 2008-06-30 13:59:58
Message-ID: 55df879eca51788820f4901696195c35.squirrel@zenmail.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, June 30, 2008 4:51 pm, Tom Lane wrote:
> The string "out of balance" appears nowhere in the PG 8.2.x sources.
> So I suppose it must have come from some add-on code, or perhaps got
> inserted on the client side. What data type is that column, and what
> non-core code is involved?

I have no idea where this comes from - I've grepped globally for that
silly string and can't find it. The installation is pretty standard -
pg+plsql. Must be something deep which I've forgotten about.

The problem was this: a silly SQL error (misuse of OR and missing
parentheses) resulted in a massive result set which resulted in OOM - if
the select is run manually (no funny "out of balance" strings).

If it's run in a function (which uses a FOR loop, which uses implicit
cursors), then the "out of balance" string is returned for the TEXT column
almost immediately.

Weird. Anyway, I'm just relieved the solution was fixing my stupid SQL.

Regards
Henry

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chandra ASGI Tech 2008-06-30 14:24:47 Re: php + postgresql website ?
Previous Message Albe Laurenz 2008-06-30 13:48:32 Re: allowed variable names in functions?