Answer the question
In order to leave comments, you need to log in
What query should be entered to determine the amount of memory used in Postgre?
select table_schema "table name", sum(data_length+index_length)/1024/1024 "Data Base Size in MB" from information_schema.TABLES GROUP BY table_schema;
Answer the question
In order to leave comments, you need to log in
I don't know where you found this query, but the error is correct - there is no such field in this table.
In general, the query "postgres get table size" among the first issues a link to postgresqltutorial.com , and there is such a wonderful query (the 5 largest tables in the current database):
SELECT
relname AS "relation",
pg_size_pretty (
pg_total_relation_size (C .oid)
) AS "total_size"
FROM
pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C .relnamespace)
WHERE
nspname NOT IN (
'pg_catalog',
'information_schema'
)
AND C .relkind <> 'i'
AND nspname !~ '^pg_toast'
ORDER BY
pg_total_relation_size (C .oid) DESC
LIMIT 5;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question