Commit 65ea4f67 authored by Bruce Momjian's avatar Bruce Momjian

Allow vacuum of temporary tables

parent 69294592
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.145 2000/04/06 00:29:51 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.146 2000/04/06 18:12:07 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "utils/portal.h" #include "utils/portal.h"
#include "utils/relcache.h" #include "utils/relcache.h"
#include "utils/syscache.h" #include "utils/syscache.h"
#include "utils/temprel.h"
#ifndef HAVE_GETRUSAGE #ifndef HAVE_GETRUSAGE
#include "rusagestub.h" #include "rusagestub.h"
...@@ -315,14 +316,20 @@ vc_getrels(NameData *VacRelP) ...@@ -315,14 +316,20 @@ vc_getrels(NameData *VacRelP)
if (NameStr(*VacRelP)) if (NameStr(*VacRelP))
{ {
/* /*
* we could use the cache here, but it is clearer to use scankeys * we could use the cache here, but it is clearer to use scankeys
* for both vacuum cases, bjm 2000/01/19 * for both vacuum cases, bjm 2000/01/19
*/ */
char *nontemp_relname;
/* We must re-map temp table names bjm 2000-04-06 */
if ((nontemp_relname =
get_temp_rel_by_username(NameStr(*VacRelP))) == NULL)
nontemp_relname = NameStr(*VacRelP);
ScanKeyEntryInitialize(&key, 0x0, Anum_pg_class_relname, ScanKeyEntryInitialize(&key, 0x0, Anum_pg_class_relname,
F_NAMEEQ, F_NAMEEQ,
PointerGetDatum(NameStr(*VacRelP))); PointerGetDatum(nontemp_relname));
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment