title: DBD::Pg::st execute failed: ERROR: column "***" does not exist
body: <p>That's part of my code. I do SELECT using message-ID received from gmail. Msg_id stored in the database in the form of base64 and without simbols "&lt; >".</p>
  
  <pre><code>my $inbox = $imap-&gt;select("Inbox") or die "Select error: ", $imap-&gt;LastError, "\n";
  my @mails = ( $imap-&gt;unseen );
  foreach my $msgid (@mails) {
      my $m_id = $imap-&gt;parse_headers( $msgid, "Message-id" )-&gt;{"Message-id"}-&gt;[0] . "\n";
      $m_id =~ s/[&lt;\&gt;]//g;
      $m_id = encode_base64($m_id);
      $m_id =~ s/\r?$//;
      my $q1 = "select id from mails.mails_in where user_id=$param[5] and message_id=$m_id and user_remote_id=$param[6]";
      $sth = $dbh-&gt;prepare($q1);
      $rv  = $sth-&gt;execute();
      my @array;
  
      while ( @array = $sth-&gt;fetchrow_array() ) {
          foreach my $i (@array) {
              print "$i\t";
          }
          print "\n";
      }
  }
  </code></pre>
  
  <p>But getting this error.</p>
  
  <pre><code>DBD::Pg::st execute failed: ERROR:  column "zdjkot..." does not exist
  LINE 1: ...mails.mails_in where user_id=15206 and message_id=ZDJkOTQ1NT...
                                                               ^ at ./script.pl line 65.
  </code></pre>
  
  <p>I tried to use an existing msg_id, from the base - the result is similar.
  Another SELECT's work correctly.
  Similar SELECT work correctly on php.</p>
  
  <p>I use:
  Perl v5.18.2, PostgreSQL v8.4.14</p>