PostgreSQL‎ > ‎

TOAST

Find out which table a TOAST table (e.g. pg_toast_12345) corresponds to:
select n.nspname, c.relname 
from pg_class c 
  inner join pg_namespace n on c.relnamespace = n.oid 
where reltoastrelid = ( 
  select oid from pg_class 
  where relname = 'pg_toast_12345' and relnamespace = (
    SELECT n2.oid FROM pg_namespace n2 WHERE n2.nspname = 'pg_toast') );
Comments