BUG #15950: pg_freespace.avail is 0

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: daniel_adeniji(at)hotmail(dot)com
Subject: BUG #15950: pg_freespace.avail is 0
Date: 2019-08-12 18:07:31
Message-ID: 15950-281706ee6094aa6c@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 15950
Logged by: Daniel Adeniji
Email address: daniel_adeniji(at)hotmail(dot)com
PostgreSQL version: 11.4
Operating system: Windows 10
Description:

Issued the query pasted below :-
===============================

with cteSetting
(
name
, setting
)

as
(
select
name
, setting::integer

from pg_catalog.pg_settings

where name = 'block_size'
)
SELECT

tblN.nspname
as "schema"

, tblC.relname

, avg(tblC.relpages)::int
as relpages

, avg(tblC.reltuples)::int
as reltuples

, count(*) as cnt

, pg_size_pretty
(
cast
(
avg(tblPGFS.avail) as bigint
)
)
as "Av. freespace size"

/*
max(cteSBS.setting)
as "blockSize"
*/

, round
(
100
* avg
(
tblPGFS.avail
)
/
(
avg(cteSBS.setting)::int
)
,2
) as "Av. freespace ratio"

FROM pg_catalog.pg_class tblC

join pg_catalog.pg_namespace tblN

on tblC.relnamespace = tblN.oid

inner join pg_freespace(tblC.oid) tblPGFS

on TRUE

inner join cteSetting cteSBS
on cteSBS.name = 'block_size'

where tblC.relkind = 'r'

and tblN.nspname not in

(
'information_schema'
, 'pg_catalog'

)

GROUP BY

tblN.nspname

, tblC.relname

ORDER BY

tblN.nspname

, tblC.relname

;

Result :-
=========

1) pg_freespace.avail is 0

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2019-08-12 18:58:56 BUG #15951: http://www.postgresql.sk/support/submitbug not working
Previous Message Tom Lane 2019-08-12 17:17:38 Re: BUG #15892: URGENT: Using an ICU collation in a primary key column breaks ILIKE query