Thread: Temporary table and dump

Temporary table and dump

From
Emmanuel Quevillon
Date:
Hi all

I've read from the doc that a temporary table is destroyed when a
session ends.

My question is then, is a temporary table saved into a dump if pg_dump
is launched while the session that created the temporary table is not ended?

Thus, during the pg_restore, the temporary table is re-created or not?

Thanks for any clue.

Emmanuel
--
-------------------------
Emmanuel Quevillon
CIB, Centre Informatique pour la Biologie
Institut Pasteur
+33 1 44 38 95 98
tuco at_ pasteur dot fr
-------------------------


Re: Temporary table and dump

From
Albe Laurenz
Date:
Emmanuel Quevillon wrote:
> I've read from the doc that a temporary table is destroyed when a
> session ends.
> 
> My question is then, is a temporary table saved into a dump if pg_dump
> is launched while the session that created the temporary table is not ended?
> 
> Thus, during the pg_restore, the temporary table is re-created or not?

A temporary table will never be in a database dump.

The temporary table is only visible in the session that created it, and pg_dump
does not create temporary tables.

Yours,
Laurenz Albe