"George A.J" <jinujosein@yahoo.com> writes:
> When i searched the pg_class i found the temp table name more than once.
> ie, a temporary table is created for each connection.I cannot distingush
> the temp tables. But the tables are in different schema.
> Is there a method to get the current temporary schema?
Not directly, but you could try something like
perform * from pg_class where relname = 'mytable' and pg_table_is_visible(oid);if not found then ... -- create the
table
The visibility test would not succeed for temp tables belonging to other
backends. (If 'mytable' is also used as the name of a regular table
then this isn't quite good enough, but I think just avoiding such a name
collision is easier than extending the check to reject non-temp tables.)
regards, tom lane