Re: "out of balance" result on select from suspected index corruption [RESOLVED] - Mailing list pgsql-general

From Henry - Zen Search SA
Subject Re: "out of balance" result on select from suspected index corruption [RESOLVED]
Date
Msg-id 55df879eca51788820f4901696195c35.squirrel@zenmail.co.za
Whole thread Raw
In response to Re: "out of balance" result on select from suspected index corruption  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: "out of balance" result on select from suspected index corruption [RESOLVED]  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-general by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: tsearch strategy for incremental search
Next
From: paragasu
Date:
Subject: Re: php + postgresql website ?