Contents
pg_column_size()
A system function for showing the size of data in a table column
pg_column_size()
is a system function for showing the size of data in a table column.
pg_column_size()
was added in PostgreSQL 8.1.
Examples
postgres=# CREATE TABLE foo (id INT, val TEXT); CREATE TABLE postgres=# INSERT INTO foo VALUES(1,'abc'), (2,'Hello World'); INSERT 0 2 postgres=# SELECT id, pg_column_size(id), val, pg_column_size(val) FROM foo; id | pg_column_size | val | pg_column_size ----+----------------+-------------+---------------- 1 | 4 | abc | 4 2 | 4 | Hello World | 12 (2 rows)
References
- PostgreSQL documentation: Database Object Size Functions