title: Kafka Connect - JSON Converter - JDBC Sink Connector - Column Type JSON
body: <p>use case is to store entire message (which is JSON) and key as a record in table which has two columns 'id' and 'data'.</p>
  
  <p>The database is Postgres and it supports column type as JSON.</p>
  
  <p>As per this article, supported types in JSONConverter are string, int64, etc
  <a href="https://cwiki.apache.org/confluence/display/KAFKA/KIP-301%3A+Schema+Inferencing+for+JsonConverter" rel="nofollow noreferrer">https://cwiki.apache.org/confluence/display/KAFKA/KIP-301%3A+Schema+Inferencing+for+JsonConverter</a></p>
  
  <p>Is it possible to have type of data field as JSON which then can be stored in Postgres DB with column of type JSON.</p>
  
  <pre><code>schema = `{
  "type":"struct",
  "fields":[
      {"type":"string", "optional": false, "field":"id"},
      {"type":"string", "optional": false, "field":"data"}
  ]}`
  </code></pre>
  
  <p>Sample data payload is </p>
  
  <pre><code>"payload": { "id": 10000, "data": {"hello":"world"} }
  </code></pre>
  
  <p>Above will store data as text and expects column to be of type text in Postgres.
  If the column on Postgres is of type JSON then the JDBC Sink Connector will throw an error.</p>
  
  <p>Using JSON types on Postgres will help to create index on JSON fields and so forth. Is it possible to use JSONConverter along with JDBC Sink Converter appropriately for storing records with column type JSON.</p>