In recent versions of postgreSQL one can use the syntax:
create temp table if not exist my_table as
...
to create a temporary table if it doesn't exist yet.
However, the clause if not exist
is a relatively recent feature.
I am working against a database that uses PostgreSQL version 8.2.15. How can I create a temporary table if it doesn't exist yet?