Size of a column in Postgres

Posted on August 8, 2025 by Riccardo

pg_column_size ( "any" ) → integer "Shows the number of bytes used to store any individual data value. If applied directly to a table column value, this reflects any compression that was done."

Example:

SELECT name, pg_column_size(name) FROM table

PinkLetter

It's one of the selected few I follow every week – Mateusz

Tired of RELEARNING webdev stuff?

  • A 100+ page book with the best links I curated over the years
  • An email once a week full of timeless software wisdom
  • Your recommended weekly dose of pink
  • Try before you buy? Check the archives.