Re: SQL Exception Relation xxx does not exist

From: Kris Jurka <books(at)ejurka(dot)com>
To: Alex <alex(at)meerkatsoft(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: SQL Exception Relation xxx does not exist
Date: 2004-01-21 11:33:32
Message-ID: Pine.LNX.4.33.0401210627570.17581-100000@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy pgsql-general pgsql-hackers

On Wed, 21 Jan 2004, Alex wrote:

> Kris,
> thanks for the reply. I dont actually use temp tables in the function
> (not that I know of) but I did truncated and reloaded a few tables incl.
> recreating indices the previous day, however the line no. indicated in
> the serverlog does not point to these sql calls.
>
> I am now re-starting tomcat every night which is not a bad thing anyway
> but still am wondering what the real reason could be.
>

The reason is probably the recreation of the indexes. When a plpgsql
procedure is first executed it takes the queries in it, plans them, and
saves that query plan so that every time afterward the procedure just uses
the stored plan. The problem is that one of the plans depended on one of
the indexes. When the index was dropped the procedure tried to run a plan
that was no longer valid, generating the error you saw. Restarting tomcat
closes and reopens the connection to the database, so the query in the
procedure gets replanned to use the new index and things run smoothly.

Kris Jurka

In response to

Browse pgsql-advocacy by date

  From Date Subject
Next Message George Essig 2004-01-21 15:04:49
Previous Message Alex 2004-01-21 05:25:23 Re: SQL Exception Relation xxx does not exist

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2004-01-21 11:59:14 Re: SCO Extortion
Previous Message lnd 2004-01-21 10:49:25 Ending transaction inside stored function

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Brusser 2004-01-21 12:46:41 Re: Slow query - index not used
Previous Message Gavin Sherry 2004-01-21 11:20:47 Re: SET WITHOUT OIDS and VACUUM badness?