pg_total_relation_size()
pg_total_relation_size('relation_name');
relation_name
CREATE TABLE users ( username TEXT, email TEXT ); INSERT INTO users (username, email) VALUES ('john_doe', '[email protected]'), ('jane_smith', '[email protected]'), ('alice_smith', '[email protected]'), ('bob_jones', '[email protected]'), ('susan_wilson', '[email protected]'), ('michael_jackson', '[email protected]'), ('lisa_johnson', '[email protected]'), ('david_smith', '[email protected]');
SELECT pg_total_relation_size('users');
pg_total_relation_size ------------------------ 556