2 * If you want the statistics of per-relation or per-column, please modify
3 * nspname, relname, and attname in 'WHERE' clause.
6 BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
8 * If you want to chage the output file name, please modify the following name.
12 COPY (SELECT n2.nspname,
19 COALESCE(a.attname, ''),
20 n1.nspname AS schemaname_of_atttype,
43 FROM dbms_stats.column_stats_effective co
45 ON (co.starelid = a.attrelid AND co.staattnum = a.attnum)
49 ON t.typnamespace = n1.oid
50 RIGHT JOIN dbms_stats.relation_stats_effective r
51 ON co.starelid = r.relid
52 JOIN pg_catalog.pg_class cl
54 JOIN pg_catalog.pg_namespace n2
55 ON cl.relnamespace = n2.oid
56 -- WHERE n2.nspname = 'public'
57 -- AND cl.relname = 'test'
58 -- AND a.attname = 'id'
59 ORDER BY starelid, staattnum)