title: PostgreSQL C String to CHARACTER internal representation
body: <p>I am trying to convert a C String to character internal representation of PostgreSQL. I am using <code>bpcharin</code> function in <code>varchar.c</code>. This function requires two arguments : the C String Datum and the <code>atttypmod</code>. It is mentioned that <code>atttypmod</code> is the declared length of the type plus VARHDRSZ.</p>
  
  <p>My conversion function is:</p>
  
  <pre><code>result = DirectFunctionCall2(bpcharin,
                          CStringGetDatum(str),
                          VARHDRSZ + ?);
  </code></pre>
  
  <p>My string <code>str</code> value will be one of the column datatype of my table. So, I require the declared column data type length. This information is stored in <code>character_maximum_length</code> of <code>information_schema.columns</code> view.</p>
  
  <p>My question is, how do I get the <code>character_maximum_length</code> in C code?</p>
  
  <p>Thank you. </p>