list files and sizes

From: richard(at)xentu(dot)com
To: pgsql-novice(at)postgresql(dot)org
Subject: list files and sizes
Date: 2016-02-20 21:40:20
Message-ID: c3a5ff17680fd129b7465550c5362269@xentu.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Could anyone tell me if this is possible?

I can get a list of files from the pg_log directory using

select * from pg_ls_dir('pg_log')

For any one of those files, I could find out it's size using

select * from pg_stat_file('pg_log\postgresql-2016-02-16_133214.log')

but, what I'd like to have is a query that somehow combines those two
and returns a recordset consisting of two columns, file_name & file_size

I could probably write procedural code to do this, but am thinking it
maybe can be done, somehow, in a single statement.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Joe Conway 2016-02-20 21:59:43 Re: list files and sizes
Previous Message Killian Driscoll 2016-02-18 21:32:37 Re: Create view that retrieves both table and column comments