Re: PSQLException: ERROR: could not open relation with OID xxxx - Mailing list pgsql-admin

From Kevin Grittner
Subject Re: PSQLException: ERROR: could not open relation with OID xxxx
Date
Msg-id 4D7F440A020000250003B8CD@gw.wicourts.gov
Whole thread Raw
In response to Re: PSQLException: ERROR: could not open relation with OID xxxx  ("Gnanakumar" <gnanam@zoniac.com>)
List pgsql-admin
"Gnanakumar" <gnanam@zoniac.com> wrote:

>> If that doesn't do it I might try adding zero to numbers and
>> concatenating empty strings to try to prevent late use of the
>> OID.  (Essentially as a form of optimization barrier.)
>
> I couldn't understand this approach clearly. Can you help explain
> me with some example?

For a string it would be changing something like this:

    schemaname,

to something like this:

    schemaname || '' AS schemaname,

for a number it might be changing:

    pg_total_relation_size(schemaname||'.'||tablename)

to:

    pg_total_relation_size(schemaname||'.'||tablename) + 0

Again, I would try without these first.  If the problem persists I
would sprinkle these throughout the query.  If the problem goes
away, I would probably selectively remove them until the problem
returned, so I would know where it matters.

-Kevin

pgsql-admin by date:

Previous
From: "Maria L. Wilson"
Date:
Subject: log timestamp since daylight saving time
Next
From: Scott Marlowe
Date:
Subject: Re: log timestamp since daylight saving time