title: How can I determine if a postgres temporary table was created?
body: <p>When running a query that creates a temporary table if it doesn't exist, how do I determine if a new table was actually created?</p>
  
  <p>For example if I create a temporary table with <code>CREATE TEMP TABLE IF NOT EXISTS name</code> can I get the query to return something if a new table was created or not?</p>
  
  <p>In my specific case, upon creating a temporary table I then run another query to copy some data to it so I need to ensure that I am only copying the data if the temporary table was recreated (if for example the table was dropped because of some momentary connection drop out or something). I am using psycopg2.</p>