Other Functions
PG_TOTAL_RELATION_SIZE
Overview
The pg_total_relation_size
function allows you to retrieve the size of a table. This function is useful for monitoring the storage requirements.
Syntax
The syntax for the pg_total_relation_size
function is as follows:
Here, relation_name is the name of the table for which you want to determine the size.
Output
The pg_total_relation_size
function returns the size of the specified table in bytes.
Example
- First, let’s assume we have a table named **users. **Use the below query to create the table.
- In this case, we will use the
pg_total_relation_size
function to determine the size of a users table.
- This query will return the size of the users table in bytes.