Re: [BUGS] BUG #14659: "ERROR: could not open relation with OID" when creating table from SELECT with large row

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] BUG #14659: "ERROR: could not open relation with OID" when creating table from SELECT with large row
Дата
Msg-id 21218.1495120309@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [BUGS] BUG #14659: "ERROR: could not open relation with OID" when creatingtable from SELECT with large row  (kwan.lim@gmail.com)
Список pgsql-bugs
kwan.lim@gmail.com writes:
> We have a UDF that creates a temporary table from a SELECT statement then
> returns the result and drops the table.
> For certain cases where it appears that there are large strings in some
> columns the UDF fails with: "ERROR: could not open relation with OID"

What seems to be happening is that if the strings are large enough to be
toasted, then the data returned out of the function with RETURN QUERY
contains toast pointers referencing the temp table's toast table.
If you drop the temp table then those pointers will fail upon use.

In this particular example there's an obvious workaround: lose the final
DROP TABLE.  The function's initial "DROP IF EXISTS" will serve just fine.

It seems like what we'd have to do to fix this is to detoast datums
that are going into the returned tuplestore.  That's pretty annoying
from a performance standpoint, but I don't see any good alternative.
        regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

В списке pgsql-bugs по дате отправления:

Предыдущее
От: kwan.lim@gmail.com
Дата:
Сообщение: [BUGS] BUG #14659: "ERROR: could not open relation with OID" when creatingtable from SELECT with large row
Следующее
От: tbrandys@webcellence.com
Дата:
Сообщение: [BUGS] BUG #14660: Conversion to UTC not properly computed