Re: BUG #4051: ERROR: relation with OID xxxx does not exist

From: "Pavan Deolasee" <pavan(dot)deolasee(at)gmail(dot)com>
To: "N Jagan Mohan Rao" <n(dot)jaganmohanrao(at)rediffmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4051: ERROR: relation with OID xxxx does not exist
Date: 2008-03-24 13:24:56
Message-ID: 2e78013d0803240624y6b57caf1ocfb0e81749b3b74c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Mar 24, 2008 at 5:50 PM, N Jagan Mohan Rao
<n(dot)jaganmohanrao(at)rediffmail(dot)com> wrote:

>
> I am using EntityManager, NativeQueries and deleting postgresql tables and
> createing them dinamically(the schema is generated by using hybernate-tool).
> till this point it is working fine .. and in the same transaction i am
> putting some data and saving it through entitymanager and hence I am getting
> the problem "ERROR: relation with OID xxxxxx does not exist" please give the
> solution for this. I tried but I am unable to fix it.
>

I don't know much about EntityManager etc, but I have seen this issue with
plpgsql functions on version older than 8.3 (starting 8.3, we have plan
invalidation which addresses this problem)

For example, a simple way to reproduce this on pre-8.3 versions is:

postgres=# CREATE TABLE test (a int);
CREATE TABLE

postgres=# CREATE OR REPLACE FUNCTION testfunc(integer) RETURNS VOID AS
$$
BEGIN
INSERT INTO test VALUES (1);
END;
$$
language plpgsql;
CREATE FUNCTION

postgres=# SELECT testfunc(0);
testfunc
----------

(1 row)

postgres=# DROP TABLE test;
DROP TABLE

postgres=# SELECT testfunc(0);
ERROR: relation with OID 16390 does not exist
CONTEXT: SQL statement "INSERT INTO test VALUES (1)"
PL/pgSQL function "testfunc" line 2 at SQL statement

If upgrading to 8.3.1 is an option, you can try that.

Thanks,
Pavan

--
Pavan Deolasee
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message mjevans1983 2008-03-24 16:20:50 BUG #4052: GCC update -fwrapv and new -Wstrict-overflow
Previous Message N Jagan Mohan Rao 2008-03-24 12:20:48 BUG #4051: ERROR: relation with OID xxxx does not exist