Re: ERROR: could not open relation with OID 2836

From: Rodrigo Gonzalez <rjgonzale(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: ERROR: could not open relation with OID 2836
Date: 2008-06-27 16:55:52
Message-ID: 48651B98.6030005@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Rodrigo Gonzalez <rjgonzale(at)gmail(dot)com> writes:
>> pg_dump is working fine now, the problem appear with the pg_buffercache
>> query...without it I dont notice anything wrong with DB....but of course
>> there is something wrong. Can be pg_buffercache the problem?
>
> Oh ... looking again at your latest problem query, the query is buggy:
>
> db=# SELECT ... pg_relation_size(c.relname) ...
> FROM pg_class c INNER JOIN pg_buffercache b ON b.relfilenode = c.relfilenode ...
> ERROR: relation "pg_toast_1255" does not exist
>
> The pg_toast schema isn't in your search path so you can't just do
> "pg_relation_size(c.relname)". You'd be better off using
> pg_relation_size(c.oid) anyway.
>
> I was misled by the chance coincidence that pg_proc's toast table was
> the one mentioned, otherwise I'd probably have seen this sooner.
>
> So this is not a bug, and not related to the original problem. We still
> don't know what the original problem was, but I wonder if it might have
> been of the same ilk. I don't think you ever showed us the exact query
> that led to the "could not open relation" message?
>
> regards, tom lane

Ok, adding pg_toast to search path worked fine. I dont understand why in
my laptop machine with the same search path ("$user",public) worked
without problem.

I will see how to get the problem again, cause this query was the one
that returned problem at oid 2836. So cannot reproduce right now.

Thanks for your time and if I see the error again I will write again.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message wstrzalka 2008-06-27 16:59:14 Nice to have: reverse() function in the core
Previous Message Tom Lane 2008-06-27 16:32:08 Re: ERROR: could not open relation with OID 2836