I am migrating my application from MySQL to PostgreSQL. In MySQL, I have used a query to calculate memory size of particular tables as per my requirement using the below Query,
SELECT SUM(ROUND(((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024),2)) 'Size in MB' FROM INFORMATION_SCHEMA.TABLES where TABLE_NAME like 'table_name';
But I can't do the same in PostgreSQL. If I run the same query it is displaying as,
ERROR: type "sum" does not exist
And I have tried the solutions in various sites but I can't find the exact solution for my requirement. Please suggest me a solution. Thanks in advance.