Alright I figured it out. 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. If I don't drop the tmp_base table at the end of the function, it will work just fine. If I keep the drop at the end in there, it'll blow up every time. This seriously seems like a bug to me. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general