select attname, inherited, n_distinct,
array_to_string(most_common_vals, E';') as most_common_vals,most_common_freqs
from pg_stats
where tablename = 'table_name' ;
personal blog
select attname, inherited, n_distinct,
array_to_string(most_common_vals, E';') as most_common_vals,most_common_freqs
from pg_stats
where tablename = 'table_name' ;