pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: pinker <pinker@onet.eu>
To: pgsql-general@postgresql.org
Subject: Re: Possible bug: could not open relation with OID [numbers] SQL State: XX000
Date: Fri, 19 Jan 2018 18:54:34 -0700 (MST)
Message-ID: <1516413274908-0.post@n3.nabble.com> (raw)
In-Reply-To: <23105.1509594355@sss.pgh.pa.us>
References: <CAMjNa7ckR8BAsW2Lu3VUSzTqY5SH0dprZU5=NH_nsHaJ_ynJ-g@mail.gmail.com>
	<20171101220354.GB22239@telsasoft.com>
	<CAMjNa7dkMbYVF0JPMMQ7WpT=4mFTBaJwwt5nSP0BCBb9bbwDTg@mail.gmail.com>
	<CAMjNa7eLii9EcuPERJoGGvUw7q+MDHd9B4SCNpXkf14662e+Tw@mail.gmail.com>
	<13901.1509586595@sss.pgh.pa.us>
	<CAMjNa7dbukpQNUcG_z58BBzmhjh816MgRjq0rFttXehxwSYU3Q@mail.gmail.com>
	<21716.1509592353@sss.pgh.pa.us>
	<23105.1509594355@sss.pgh.pa.us>

I would like to refresh the topic and add another report about the issue that
just happened to me.I'm sure it's the toast table that cannot be opened
inside the function.I have added following RAISE NOTICE clauses to it and
run analyze inside of the function:  
    analyze verbose temp_table; 
    raise notice 'oid temp_table %', ( SELECT array_agg(relname::TEXT||
relfilenode::TEXT|| 'relpages:'||relpages::TEXT|| 'reltuples:' ||
reltuples::TEXT|| 'relallvisible:' ||relallvisible::TEXT||'reltoastrelid:'||
reltoastrelid::TEXT) FROM pg_class where relname= 'temp_table');
    raise notice 'rel size %', (select
pg_total_relation_size('temp_table'));
It's pointing to the toast table:
1 live rows and 1 dead rows; 1 rows in sample, 1 estimated total
rowspsql:/tmp/gg:23: NOTICE:  oid temp_table
{temp_table106538relpages:1reltuples:1relallvisible:0reltoastrelid:*106541*}psql:/tmp/gg:23:
NOTICE:  rel size 32768psql:/tmp/gg:23: ERROR:  could not open relation with
OID *106541*
Thank you for the advice about ON COMMIT DROP - it's working.When the table
size is smaller, about 16k this issue simply disappears.



--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html

view thread (10+ messages)

Message-ID: <1516413274908-0.post@n3.nabble.com>
Permalink:  ../1516413274908-0.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1516413274908-0.post@n3.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: pinker@onet.eu
  Subject: Re: Possible bug: could not open relation with OID [numbers] SQL State: XX000
  In-Reply-To: <1516413274908-0.post@n3.nabble.com>
  References: <CAMjNa7ckR8BAsW2Lu3VUSzTqY5SH0dprZU5=NH_nsHaJ_ynJ-g@mail.gmail.com> <20171101220354.GB22239@telsasoft.com> <CAMjNa7dkMbYVF0JPMMQ7WpT=4mFTBaJwwt5nSP0BCBb9bbwDTg@mail.gmail.com> <CAMjNa7eLii9EcuPERJoGGvUw7q+MDHd9B4SCNpXkf14662e+Tw@mail.gmail.com> <13901.1509586595@sss.pgh.pa.us> <CAMjNa7dbukpQNUcG_z58BBzmhjh816MgRjq0rFttXehxwSYU3Q@mail.gmail.com> <21716.1509592353@sss.pgh.pa.us> <23105.1509594355@sss.pgh.pa.us> <1516413274908-0.post@n3.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox