Adam Brusselback <adambrusselback@xxxxxxxxx> writes: > The OID does not match any of the temp tables, so not sure what's up there. > I have the function RETURN QUERY, > and then I drop all my temp tables. I'll bet the OID corresponds to the toast table for one of those temp tables. RETURN QUERY will stash away all the values read by the query, but it doesn't make an attempt to inline out-of-line values; so you get a failure when the out-of-line column value is eventually demanded. I think we've seen one previous complaint of the same ilk. Probably somebody will get annoyed enough to fix it at some point, but the sticking point is how to cover this corner case without causing a performance drop for normal cases. In the meantime, maybe you could make the temp tables be ON COMMIT DROP instead of dropping them explicitly mid-transaction. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general