title: libpq only inserts first character in string column
body: <p>So I have this structure in my psql table called <code>rooms</code>:</p>
  
  <pre><code>                                         Table "public.rooms"
           Column          |          Type          |                     Modifiers
  -------------------------+------------------------+----------------------------------------------------
   id                      | integer                | not null default nextval('rooms_id_seq'::regclass)
   room_id                 | integer                |
   room_name               | character varying(100) |
   room_secret             | character varying(255) |
   room_pin                | character varying(100) |
   room_communication_type | character varying(30)  |
  Indexes:
      "rooms_pkey" PRIMARY KEY, btree (id)
      "index_rooms_on_room_id" UNIQUE, btree (room_id)
      "index_rooms_on_room_name" btree (room_name)
      "index_rooms_on_room_secret" btree (room_secret)
  </code></pre>
  
  <p>And when I try to perform and insert statement from my C program, I get these results:</p>
  
  <pre><code>janus_audiobridge=# SELECT * FROM rooms;
   id | room_id | room_name | room_secret | room_pin | room_communication_type
  ----+---------+-----------+-------------+----------+-------------------------
    1 |  111128 | I         | L           |          | r
    3 |  111129 | C         | c           |          | r
    4 |  111130 | 4         | b           |          | r
    6 |  111131 | 5         | b           |          | r
  (4 rows)
  </code></pre>
  
  <p>Notice the <code>room_name</code>, <code>room_secret</code> and <code>room_communication_type</code> only contain 1 character, the origin al data i wanted insert is full sentences of text.</p>
  
  <p>This is my C code:</p>
  
  <pre><code>  const char *paramValues[5];
    paramValues[0] = "111131";
    paramValues[1] = room-&gt;room_name;
    paramValues[2] = room-&gt;room_secret;
    paramValues[3] = room-&gt;room_pin;
    paramValues[4] = room-&gt;room_communication_type;
  
  
    JANUS_LOG(LOG_WARN, "name: %s", paramValues[1]);
  
    JANUS_LOG(LOG_ERR, "44444\n\n\n");
    PGresult *res = PQexecParams(conn, query,
      5,       /* one param */
      NULL,    /* let the backend deduce param type */
      paramValues,
      NULL,    /* don't need param lengths since text */
      NULL,    /* default to all text params */
      0);      /* ask for text results */
  </code></pre>
  
  <p>When I run the <code>INSERT</code> the line <code>JANUS_LOG</code> returns correct name, but inserts only the first character.</p>
  
  <p>How can i insert full text into postgres database using libpq?</p>
  
  <p>Thanks!</p>
  
  <p>EDIT: my <code>query</code> string:</p>
  
  <pre><code>gchar *query = "INSERT INTO rooms(room_id, room_name, room_secret, room_pin, room_communication_type) " 
  "VALUES($1::int, $2::char, $3::char, $4::char, $5::char);";
  </code></pre>