title: Redshift drop/create/select query failing in Data Pipeline
body: <p>I'm trying to run a daily migration script in Redshift using Data Pipeline.<br>
  The script works as expected when I run it directly using SQL Workbench/J, but fails when triggered through Data Pipeline.</p>
  
  <p>I have reproduced the problem with this simple code:</p>
  
  <pre class="lang-sql prettyprint-override"><code>drop table if exists image_stg;
  create table image_stg (like image_full); 
  select * from image_stg;
  </code></pre>
  
  <p>When I run it in Data Pipeline, I get this error:</p>
  
  <blockquote>
    <p>[Amazon](500310) Invalid operation: relation "image_stg" does not exist;</p>
  </blockquote>
  
  <p>I also got this error once, for the exact same code, without changing anything:</p>
  
  <blockquote>
    <p>[Amazon](500310) Invalid operation: Relation with OID 108425 does not exist.;</p>
  </blockquote>
  
  <p>Here's a screenshot of the two error messages:</p>
  
  <p><a href="https://i.stack.imgur.com/V3l8J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V3l8J.png" alt="Sad screenshot"></a></p>
  
  <p>I've found this thread on the AWS forums, but it didn't help: <a href="https://forums.aws.amazon.com/thread.jspa?messageID=678695" rel="nofollow noreferrer">Pipeline started failing on simple Redshift SqlActivity and temp table</a></p>
  
  <p>What is causing this error? Is there a workaround?</p>