B004 WAL generation (GiB per minute, hour, day?)

Example:

postgres=# select pg_current_xlog_location() as last_lsn, now() as ts \gset
postgres=# 
postgres=# select  pg_size_pretty((pg_current_xlog_location() - :'last_lsn') / (extract('epoch' from now()) - extract('epoch' from timestamptz :'ts'))::int) || '/sec';
 ?column?
-----------
 33 MB/sec
(1 row)
Edited by postgres-ai