Postgres pg_toast in autovacuum - which table?

吃可爱长大的小学妹 提交于 2019-12-03 23:11:29

I think you'll want something like:

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_15404513' 
    and relnamespace = (SELECT n2.oid FROM pg_namespace n2 WHERE n2.nspname = 'pg_toast') )

It'd be nice if Pg reported this in the vacuum command summary.

GreenReaper

Here's a shorter way:

select 15404513::regclass;

where 15404513 is pg_toast_ suffix.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!