mirror of
https://github.com/postgres/postgres.git
synced 2025-08-30 06:01:21 +03:00
Fix adding columns to a temp table.
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.42 1999/03/30 01:37:22 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.43 1999/04/13 19:04:33 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* The PortalExecutorHeapMemory crap needs to be eliminated
|
* The PortalExecutorHeapMemory crap needs to be eliminated
|
||||||
@@ -38,6 +38,8 @@
|
|||||||
#include "utils/builtins.h"
|
#include "utils/builtins.h"
|
||||||
#include "utils/mcxt.h"
|
#include "utils/mcxt.h"
|
||||||
#include "utils/portal.h"
|
#include "utils/portal.h"
|
||||||
|
#include "utils/relcache.h"
|
||||||
|
#include "utils/temprel.h"
|
||||||
#include "utils/syscache.h"
|
#include "utils/syscache.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
@@ -500,6 +502,13 @@ PerformAddAttribute(char *relationName,
|
|||||||
((Form_pg_class) GETSTRUCT(reltup))->relnatts = maxatts;
|
((Form_pg_class) GETSTRUCT(reltup))->relnatts = maxatts;
|
||||||
heap_replace(rel, &reltup->t_self, reltup, NULL);
|
heap_replace(rel, &reltup->t_self, reltup, NULL);
|
||||||
|
|
||||||
|
{
|
||||||
|
HeapTuple temptup;
|
||||||
|
|
||||||
|
if ((temptup = get_temp_rel_by_name(relationName)) != NULL)
|
||||||
|
((Form_pg_class) GETSTRUCT(temptup))->relnatts = maxatts;
|
||||||
|
}
|
||||||
|
|
||||||
/* keep catalog indices current */
|
/* keep catalog indices current */
|
||||||
CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, ridescs);
|
CatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, ridescs);
|
||||||
CatalogIndexInsert(ridescs, Num_pg_class_indices, rel, reltup);
|
CatalogIndexInsert(ridescs, Num_pg_class_indices, rel, reltup);
|
||||||
|
Reference in New Issue
Block a user