PostgreSQL – Function pg_indexes_size(oid) Does Not Exist

postgresqlpostgresql-8.4

I'm attempting an operation on a pg_class c, but getting this:

ERROR:  function pg_indexes_size(oid) does not exist
LINE 10:               , pg_indexes_size(c.oid) AS index_bytes
                         ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

Version of Postgres

$ psql --version
psql (PostgreSQL) 8.4.20
contains support for command-line editing

I tried typecasting to a few different types, but with no success.

Best Answer

8.4 is a pretty ancient version now. The function you are after is not mentioned in the docs, therefore it is sane to think it simply did not exist back then. 9.0 introduced a number of administration functions, and pg_indexes_size() is one of those.

In any case, it would be prudent to upgrade to a supported version (9.2+ at the time of writing.