title: How can pg_column_size be smaller than octet_length?
body: <p>I'm looking for getting anticipated table size by referring column type and length size. I'm trying to use <code>pg_column_size</code> for this.</p>
  
  <p>When testing the function, I realized something seems wrong with this function.</p>
  
  <p>The result value from <code>pg_column_size(...)</code> is sometimes even smaller than the return value from <code>octet_length(...)</code> on the same string.</p>
  
  <p>There is nothing but numeric characters in the column.</p>
  
  <pre><code>postgres=# \d+ t5
                             Table "public.t5"
   Column |       Type        | Modifiers | Storage  | Stats target | Description 
  --------+-------------------+-----------+----------+--------------+-------------
   c1     | character varying |           | extended |              | 
  Has OIDs: no
  
  postgres=# select pg_column_size(c1), octet_length(c1) as octet from t5;
   pg_column_size | octet 
  ----------------+-------
                2 |     1
              704 |   700
              101 |  7000
              903 | 77000
  (4 rows)
  </code></pre>
  
  <p>Is this the bug or something? Is there someone with the some formula to calculate anticipated table size from column types and length values of it?</p>