Re: PSQLException: ERROR: could not open relation with OID xxxx

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-admin(at)postgresql(dot)org>,<gnanam(at)zoniac(dot)com>
Subject: Re: PSQLException: ERROR: could not open relation with OID xxxx
Date: 2011-03-15 15:48:42
Message-ID: 4D7F440A020000250003B8CD@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Gnanakumar" <gnanam(at)zoniac(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Marlowe 2011-03-15 18:08:23 Re: log timestamp since daylight saving time
Previous Message Maria L. Wilson 2011-03-15 12:50:31 log timestamp since daylight saving time