How can I check available space of an index's pages in PostgreSQL? For tables, I can simply use pg_freespace to check available spaces like below:

postgres=&gt; SELECT count(*),avg(1000*avail/8192)/10 FROM pg_freespace('tablename');
  count  |        ?column?        
---------+------------------------
 1978140 | 1.00397105361602313000


But for indexes, it does not work.

postgres=&gt; SELECT count(*),avg(1000*avail/8192)/10 FROM pg_freespace('tablename_pkey');
  count  |          ?column?          
---------+----------------------------
 1224867 | 0.000000000000000000000000


Additionally, this is the result of same queries after VACUUM FULL:

postgres=&gt; SELECT count(*),avg(1000*avail/8192)/10 FROM pg_freespace('tablename');
  count  |          ?column?          
---------+----------------------------
 1833413 | 0.000000000000000000000000
postgres=&gt; SELECT count(*),avg(1000*avail/8192)/10 FROM pg_freespace('tablename_pkey');
 count  |          ?column?          
--------+----------------------------
 836994 | 0.000000000000000000000000
Albeit not very prominently, the documentation of pg_freespacemap mentions the following:


  For indexes, what is tracked is entirely-unused pages, rather than free space within pages. Therefore, the values are not meaningful, just whether a page is full or empty.


Your query results simply mean that you don't have a single fully free index page.