DBA Hub

📋Steps in this guide1/1

Find vaccum settings of tables

postgres=# SELECT n.nspname, c.relname, pg_catalog.array_to_string(c.reloptions || array( select 'toast.' || x from pg_catalog.unnest(tc.reloptions) x),', ') as relopts FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_class tc ON (c.reltoastrelid = tc.oid) JOIN pg_namespace n ON c.relnamespace = n.oid WHERE c.relkind = 'r' AND nspname NOT IN ('pg_catalog', 'information_schema');

postgresql configurationintermediate
by PostgreSQL
13 views
1

Find vaccum settings of tables

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
postgres=#
SELECT n.nspname, c.relname,
pg_catalog.array_to_string(c.reloptions || array(
select 'toast.' ||
x from pg_catalog.unnest(tc.reloptions) x),', ')
as relopts
FROM pg_catalog.pg_class c
LEFT JOIN
pg_catalog.pg_class tc ON (c.reltoastrelid = tc.oid)
JOIN
pg_namespace n ON c.relnamespace = n.oid
WHERE c.relkind = 'r'
AND nspname NOT IN ('pg_catalog', 'information_schema');
nspname  | relname                             | relopts
---------+-------------------------------------+------------------------
public   | test                                |
public   | city_id2                            |
public   | test2                               | autovacuum_enabled=off

Comments (0)

Please to add comments

No comments yet. Be the first to comment!