SQL snippets for PostgreSQL
select sum((pg_stat_file('pg_xlog/' || file)).size) from pg_ls_dir('pg_xlog') as file where file ~ '^[0-9A-F]';