|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.145 2000/04/0600:29:51 tgl Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.146 2000/04/0618:12:07 momjian Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
|
42 | 42 | #include"utils/portal.h"
|
43 | 43 | #include"utils/relcache.h"
|
44 | 44 | #include"utils/syscache.h"
|
| 45 | +#include"utils/temprel.h" |
45 | 46 |
|
46 | 47 | #ifndefHAVE_GETRUSAGE
|
47 | 48 | #include"rusagestub.h"
|
@@ -315,14 +316,20 @@ vc_getrels(NameData *VacRelP)
|
315 | 316 |
|
316 | 317 | if (NameStr(*VacRelP))
|
317 | 318 | {
|
318 |
| - |
319 | 319 | /*
|
320 | 320 | * we could use the cache here, but it is clearer to use scankeys
|
321 | 321 | * for both vacuum cases, bjm 2000/01/19
|
322 | 322 | */
|
| 323 | +char*nontemp_relname; |
| 324 | + |
| 325 | +/* We must re-map temp table names bjm 2000-04-06 */ |
| 326 | +if ((nontemp_relname= |
| 327 | +get_temp_rel_by_username(NameStr(*VacRelP)))==NULL) |
| 328 | +nontemp_relname=NameStr(*VacRelP); |
| 329 | + |
323 | 330 | ScanKeyEntryInitialize(&key,0x0,Anum_pg_class_relname,
|
324 | 331 | F_NAMEEQ,
|
325 |
| -PointerGetDatum(NameStr(*VacRelP))); |
| 332 | +PointerGetDatum(nontemp_relname)); |
326 | 333 | }
|
327 | 334 | else
|
328 | 335 | {
|
|