title: Using dplyr to create and retrieve data from temporary postgres table
body: <p>I am trying to figure out how to retrieve data from a temporary table created on a Postgres database using dplyr.  The following code works (I am able to create a temp table using R, and retrieve those results).</p>
  
  <pre><code>flights.db &lt;- src_postgres(dbname = dbname, host = host, port = port,
                             user = user, password=pwd)
  drv &lt;- dbDriver("PostgreSQL")
  con &lt;- dbConnect(drv, host = host, port = port, dbname = dbname, user = user, password = pwd)
  
  ## Writes the SQL code to create a temporary table on the Postgres Database
  sql_tmp_create &lt;- paste0('create temp table tmptblaa as 
                select * from connections
                where \"Carrier\" = \'AA\' and \"Year\" = \'2015\'   ')
  
  ## Executes the code
  dbSendQuery(con, sql_tmp_create)
  
  ## Return 10 results from temporary table on Postgres
  dbGetQuery(con, 'select * from tmptblaa limit 10')
  </code></pre>
  
  <p>However, this does not work for me, and I receive an error that the table does not exist:</p>
  
  <pre><code>flights &lt;-tbl(flights.db, "tmptblaa")
  </code></pre>
  
  <p>Any ideas what I could be doing wrong?  For more context, this is to improve the efficiency of a Shiny app that I am working on for a school project.  Thanks.</p>