Re: BUG #4051: ERROR: relation with OID xxxx does not exist - Mailing list pgsql-bugs

From Pavan Deolasee
Subject Re: BUG #4051: ERROR: relation with OID xxxx does not exist
Date
Msg-id 2e78013d0803240624y6b57caf1ocfb0e81749b3b74c@mail.gmail.com
Whole thread Raw
In response to BUG #4051: ERROR: relation with OID xxxx does not exist  ("N Jagan Mohan Rao" <n.jaganmohanrao@rediffmail.com>)
List pgsql-bugs
On Mon, Mar 24, 2008 at 5:50 PM, N Jagan Mohan Rao
<n.jaganmohanrao@rediffmail.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

pgsql-bugs by date:

Previous
From: "N Jagan Mohan Rao"
Date:
Subject: BUG #4051: ERROR: relation with OID xxxx does not exist
Next
From: ""
Date:
Subject: BUG #4052: GCC update -fwrapv and new -Wstrict-overflow