Tom Lane wrote:
Alvaro Herrera <[EMAIL PROTECTED]> writes:
BTW in testing this patch I was surprised by the fact that temp tables
files are removed at checkpoint time,

[ blink... ]  Doesn't look like that should happen.  What is your
test case?

Hmph, must be because of the patch from last winter to prevent relfilenode reuse until next checkpoint. Looks like we didn't make an exception for temporary tables. Although it's harmless, we could put an isTempOrToastNamespace() test in there:

*** md.c        11 Aug 2008 11:05:11 -0000      1.139
--- md.c        18 Sep 2008 06:22:13 -0000
***************
*** 19,24 ****
--- 19,25 ----
  #include <sys/file.h>

  #include "catalog/catalog.h"
+ #include "catalog/namespace.h"
  #include "miscadmin.h"
  #include "postmaster/bgwriter.h"
  #include "storage/fd.h"
***************
*** 324,330 ****
        /*
         * Delete or truncate the first segment.
         */
!       if (isRedo || forkNum != MAIN_FORKNUM)
                ret = unlink(path);
        else
        {
--- 325,331 ----
        /*
         * Delete or truncate the first segment.
         */
! if (isRedo || forkNum != MAIN_FORKNUM || isTempOrToastNamespace(rnode.spcNode))
                ret = unlink(path);
        else
        {

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to