title: Error in dbPreExists && !overwrite : invalid 'x' type in 'x && y'
body: <p>I'm executing SQL using RPostgreSQL and sqldf packages. </p>
  
  <p>Connection:</p>
  
  <pre><code>drv &lt;- dbDriver("PostgreSQL")
  con &lt;- dbConnect(drv, dbname="dbname",host="host",port=5432,user="usr",password="pwd")
  </code></pre>
  
  <p>Then I build a pretty complex SQL statement and at the end I have (<code>vSQL</code> is the SQL select statement):</p>
  
  <pre><code>vSQLDF &lt;- sqldf(vSQL, connection=con)
  </code></pre>
  
  <p>Now I get the following error:</p>
  
  <pre><code>Error in dbPreExists &amp;&amp; !overwrite : invalid 'x' type in 'x &amp;&amp; y'
  </code></pre>
  
  <p>I was not able to create any reproducible example, all I can say is:</p>
  
  <ol>
  <li>The generated SQL statement works when executed directly in the database (I've copied the string from R to pgAdmin)</li>
  <li>The connection works, I can use <code>sqldf("select * from any_table, connection=con")</code></li>
  <li>It works when I generate shorter SQL using different input parameters for my script</li>
  <li>The SQL length only is not a problem, I've tried: <code>inSQL =  paste(rep("select 1::int ",10000),collapse=" union all ")</code>, which results in different error: <code>RS-DBI driver: (could not Retrieve the result : ERROR:  stack depth limit exceeded</code></li>
  <li>There are no strange characters in my SQL statement</li>
  </ol>
  
  <p>Any idea what this error means?</p>
  
  <p>Session info:</p>
  
  <pre><code>&gt; sessionInfo()
  R version 2.15.2 (2012-10-26)
  Platform: x86_64-pc-linux-gnu (64-bit)
  
  locale:
   [1] LC_CTYPE=cs_CZ.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8        LC_COLLATE=cs_CZ.UTF-8     LC_MONETARY=en_GB.UTF-8   
   [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=C                 LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
  [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       
  
  attached base packages:
  [1] tcltk     stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
   [1] lattice_0.20-13       sqldf_0.4-6.4         RSQLite.extfuns_0.0.1 RSQLite_0.11.2        chron_2.3-43          gsubfn_0.6-5         
   [7] proto_0.3-10          RPostgreSQL_0.3-3     DBI_0.2-5            
  
  loaded via a namespace (and not attached):
  [1] grid_2.15.2  tools_2.15.2
  </code></pre>
  
  <p>PostgreSQL:</p>
  
  <pre><code>PostgreSQL 9.1.9 on x86_64-unknown-linux-gnu, compiled by gcc-4.4.real (Debian 4.4.5-8) 4.4.5, 64-bit
  </code></pre>
  
  <p>RStudio 0.97.332</p>