My question is above. How can I calculate the growth of the database between running the script times if I have text fields as a total_size?
I've made a query but it doesn't show the data:
SELECT
b.snap_id, b.dttm - a.dttm,
(SELECT NULLIF(regexp_replace(snapshots.snap_pg_size_pretty.total_size,'','MB'), '')::numeric as t_db_growth
FROM snapshots.snap_pg_size_pretty)
FROM
snapshots.snap_pg_size_pretty a,
snapshots.snap_pg_size_pretty b
WHERE
a.snap_id = $1
AND b.snap_id = $2
ORDER BY
snap_id DESC;