Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 4FDEE1337BA4 for ; Tue, 15 Mar 2011 12:48:56 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 30634-01 for ; Tue, 15 Mar 2011 15:48:48 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 305051337B8D for ; Tue, 15 Mar 2011 12:48:48 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Tue, 15 Mar 2011 10:48:47 -0500 Message-Id: <4D7F440A020000250003B8CD@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Tue, 15 Mar 2011 10:48:42 -0500 From: "Kevin Grittner" To: , Subject: Re: PSQLException: ERROR: could not open relation with OID xxxx References: <006d01cbdfd5$f48becb0$dda3c610$@com> <4D7DEB6B020000250003B821@gw.wicourts.gov> <003601cbe2df$bf0c7480$3d255d80$@com> In-Reply-To: <003601cbe2df$bf0c7480$3d255d80$@com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/170 X-Sequence-Number: 37042 "Gnanakumar" 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