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?
For example if I create a temporary table with CREATE TEMP TABLE IF NOT EXISTS name
can I get the query to return something if a new table was created or not?
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.