title: row_to_json gives JSON with lower case field names
body: <p>I have created a custom type as following:</p>
  
  <pre><code>create type my_type as (camelCasedIdentifier uuid, ...);
  </code></pre>
  
  <p>I am using this custom type <code>my_type</code> to define the field names in a JSON body:</p>
  
  <pre><code>select row_to_json(row(my_table.id, ...)::my_type) from my_table;
  </code></pre>
  
  <p>The reason why I thought using a custom type is useful is that this way, I don't have to define the JSON field names in every query (they differ from the table column names in my case), as you would have to do with <code>json_build_object()</code>.</p>
  
  <p>The problem here however is that the field names are now all in lower case:</p>
  
  <pre><code>{"camelcasedidentifier":"d8f0a177-af13-4fa2-a2af-3bc8296d848e", ...}
  </code></pre>
  
  <p>I expected:</p>
  
  <pre><code>{"camelCasedIdentifier":"d8f0a177-af13-4fa2-a2af-3bc8296d848e", ...}
  </code></pre>
  
  <p>How can I fix this? I know this can be fixed by using <code>select json_build_object('camelCasedIdentifier', my_table.id) from my_table</code>, but I would rather not do that, as I will be forced to enumerate the JSON field names in every query.</p>