Index: src/backend/access/common/printtup.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/access/common/printtup.c,v retrieving revision 1.60 diff -u -c -r1.60 printtup.c *** src/backend/access/common/printtup.c 2001/10/25 05:49:20 1.60 --- src/backend/access/common/printtup.c 2002/02/20 04:33:42 *************** *** 268,274 **** * ---------------- */ void ! showatts(char *name, TupleDesc tupleDesc) { int i; int natts = tupleDesc->natts; --- 268,274 ---- * ---------------- */ void ! showatts(const char *name, TupleDesc tupleDesc) { int i; int natts = tupleDesc->natts; Index: src/backend/commands/command.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/commands/command.c,v retrieving revision 1.154 diff -u -c -r1.154 command.c *** src/backend/commands/command.c 2002/02/19 20:11:12 1.154 --- src/backend/commands/command.c 2002/02/20 04:33:42 *************** *** 11,17 **** * $Header: /projects/cvsroot/pgsql/src/backend/commands/command.c,v 1.154 2002/02/19 20:11:12 tgl Exp $ * * NOTES ! * The PerformAddAttribute() code, like most of the relation * manipulating code in the commands/ directory, should go * someplace closer to the lib/catalog code. * --- 11,17 ---- * $Header: /projects/cvsroot/pgsql/src/backend/commands/command.c,v 1.154 2002/02/19 20:11:12 tgl Exp $ * * NOTES ! * The AlterTableAddColumn() code, like most of the relation * manipulating code in the commands/ directory, should go * someplace closer to the lib/catalog code. * *************** *** 94,103 **** * -------------------------------- */ void ! PerformPortalFetch(char *name, bool forward, int count, - char *tag, CommandDest dest) { Portal portal; --- 94,102 ---- * -------------------------------- */ void ! PerformPortalFetch(const char *name, bool forward, int count, CommandDest dest) { Portal portal; *************** *** 167,173 **** * relations */ false, /* this is a portal fetch, not a "retrieve * portal" */ - tag, queryDesc->dest); /* --- 166,171 ---- *************** *** 248,254 **** * -------------------------------- */ void ! PerformPortalClose(char *name, CommandDest dest) { Portal portal; --- 246,252 ---- * -------------------------------- */ void ! PerformPortalClose(const char *name) { Portal portal; Index: src/backend/commands/rename.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/commands/rename.c,v retrieving revision 1.63 diff -u -c -r1.63 rename.c *** src/backend/commands/rename.c 2001/11/12 01:34:50 1.63 --- src/backend/commands/rename.c 2002/02/20 04:33:42 *************** *** 68,76 **** * delete original attribute from attribute catalog */ void ! renameatt(char *relname, ! char *oldattname, ! char *newattname, int recurse) { Relation targetrelation; --- 68,76 ---- * delete original attribute from attribute catalog */ void ! renameatt(const char *relname, ! const char *oldattname, ! const char *newattname, int recurse) { Relation targetrelation; *************** *** 127,151 **** foreach(child, children) { Oid childrelid = lfirsti(child); - char childname[NAMEDATALEN]; if (childrelid == relid) continue; ! reltup = SearchSysCache(RELOID, ! ObjectIdGetDatum(childrelid), ! 0, 0, 0); if (!HeapTupleIsValid(reltup)) { elog(ERROR, "renameatt: can't find catalog entry for inheriting class with oid %u", childrelid); } - /* make copy of cache value, could disappear in call */ - StrNCpy(childname, - NameStr(((Form_pg_class) GETSTRUCT(reltup))->relname), - NAMEDATALEN); - ReleaseSysCache(reltup); /* note we need not recurse again! */ ! renameatt(childname, oldattname, newattname, 0); } } --- 127,147 ---- foreach(child, children) { Oid childrelid = lfirsti(child); if (childrelid == relid) continue; ! reltup = SearchSysCacheCopy(RELOID, ! ObjectIdGetDatum(childrelid), ! 0, 0, 0); if (!HeapTupleIsValid(reltup)) { elog(ERROR, "renameatt: can't find catalog entry for inheriting class with oid %u", childrelid); } /* note we need not recurse again! */ ! renameatt(NameStr(((Form_pg_class) GETSTRUCT(reltup))->relname), ! oldattname, newattname, 0); ! heap_freetuple(reltup); } } *************** *** 501,506 **** --- 497,503 ---- ReleaseBuffer(buffer); continue; } + argp = (const char *) VARDATA(val); for (i = 0; i < tgnargs; i++) { *************** *** 550,558 **** continue; } ! /* ! * Construct modified tgargs bytea. ! */ newlen = VARHDRSZ; for (i = 0; i < tgnargs; i++) newlen += strlen(arga[i]) + 1; --- 547,553 ---- continue; } ! /* Construct modified tgargs bytea. */ newlen = VARHDRSZ; for (i = 0; i < tgnargs; i++) newlen += strlen(arga[i]) + 1; *************** *** 565,573 **** newlen += strlen(arga[i]) + 1; } ! /* ! * Build modified tuple. ! */ for (i = 0; i < Natts_pg_trigger; i++) { values[i] = (Datum) 0; --- 560,566 ---- newlen += strlen(arga[i]) + 1; } ! /* Build modified tuple. */ for (i = 0; i < Natts_pg_trigger; i++) { values[i] = (Datum) 0; *************** *** 579,592 **** tuple = heap_modifytuple(tuple, tgrel, values, nulls, replaces); ! /* ! * Now we can release hold on original tuple. ! */ ReleaseBuffer(buffer); ! /* ! * Update pg_trigger and its indexes ! */ simple_heap_update(tgrel, &tuple->t_self, tuple); { --- 572,581 ---- tuple = heap_modifytuple(tuple, tgrel, values, nulls, replaces); ! /* Now we can release hold on original tuple. */ ReleaseBuffer(buffer); ! /* Update pg_trigger and its indexes. */ simple_heap_update(tgrel, &tuple->t_self, tuple); { Index: src/backend/tcop/dest.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/tcop/dest.c,v retrieving revision 1.46 diff -u -c -r1.46 dest.c *** src/backend/tcop/dest.c 2001/10/28 06:25:51 1.46 --- src/backend/tcop/dest.c 2002/02/20 04:33:43 *************** *** 81,92 **** * ---------------- */ void ! BeginCommand(char *pname, int operation, TupleDesc tupdesc, bool isIntoRel, bool isIntoPortal, - char *tag, CommandDest dest) { Form_pg_attribute *attrs = tupdesc->attrs; --- 81,91 ---- * ---------------- */ void ! BeginCommand(const char *pname, int operation, TupleDesc tupdesc, bool isIntoRel, bool isIntoPortal, CommandDest dest) { Form_pg_attribute *attrs = tupdesc->attrs; Index: src/backend/tcop/pquery.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/tcop/pquery.c,v retrieving revision 1.46 diff -u -c -r1.46 pquery.c *** src/backend/tcop/pquery.c 2001/10/25 05:49:43 1.46 --- src/backend/tcop/pquery.c 2002/02/20 04:33:43 *************** *** 263,269 **** attinfo, isRetrieveIntoRelation, isRetrieveIntoPortal, - tag, dest); /* --- 263,268 ---- Index: src/backend/tcop/utility.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/tcop/utility.c,v retrieving revision 1.125 diff -u -c -r1.125 utility.c *** src/backend/tcop/utility.c 2002/02/07 00:27:30 1.125 --- src/backend/tcop/utility.c 2002/02/20 04:33:43 *************** *** 182,195 **** set_ps_display(commandTag = "CLOSE"); ! PerformPortalClose(stmt->portalname, dest); } break; case T_FetchStmt: { FetchStmt *stmt = (FetchStmt *) parsetree; ! char *portalName = stmt->portalname; bool forward; int count; --- 182,195 ---- set_ps_display(commandTag = "CLOSE"); ! PerformPortalClose(stmt->portalname); } break; case T_FetchStmt: { FetchStmt *stmt = (FetchStmt *) parsetree; ! const char *portalName = stmt->portalname; bool forward; int count; *************** *** 204,210 **** */ count = stmt->howMany; ! PerformPortalFetch(portalName, forward, count, commandTag, (stmt->ismove) ? None : dest); /* /dev/null for MOVE */ } break; --- 204,210 ---- */ count = stmt->howMany; ! PerformPortalFetch(portalName, forward, count, (stmt->ismove) ? None : dest); /* /dev/null for MOVE */ } break; Index: src/backend/utils/mmgr/portalmem.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v retrieving revision 1.45 diff -u -c -r1.45 portalmem.c *** src/backend/utils/mmgr/portalmem.c 2002/02/14 15:24:09 1.45 --- src/backend/utils/mmgr/portalmem.c 2002/02/20 04:33:43 *************** *** 134,140 **** * Returns a portal given a portal name, or NULL if name not found. */ Portal ! GetPortalByName(char *name) { Portal portal; --- 134,140 ---- * Returns a portal given a portal name, or NULL if name not found. */ Portal ! GetPortalByName(const char *name) { Portal portal; *************** *** 185,191 **** * "NOTICE" if portal name is in use (existing portal is returned!) */ Portal ! CreatePortal(char *name) { Portal portal; --- 185,191 ---- * "NOTICE" if portal name is in use (existing portal is returned!) */ Portal ! CreatePortal(const char *name) { Portal portal; Index: src/include/access/printtup.h =================================================================== RCS file: /projects/cvsroot/pgsql/src/include/access/printtup.h,v retrieving revision 1.18 diff -u -c -r1.18 printtup.h *** src/include/access/printtup.h 2001/11/05 17:46:31 1.18 --- src/include/access/printtup.h 2002/02/20 04:33:43 *************** *** 18,24 **** extern DestReceiver *printtup_create_DR(bool isBinary); ! extern void showatts(char *name, TupleDesc attinfo); extern void debugtup(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self); --- 18,24 ---- extern DestReceiver *printtup_create_DR(bool isBinary); ! extern void showatts(const char *name, TupleDesc attinfo); extern void debugtup(HeapTuple tuple, TupleDesc typeinfo, DestReceiver *self); Index: src/include/commands/command.h =================================================================== RCS file: /projects/cvsroot/pgsql/src/include/commands/command.h,v retrieving revision 1.31 diff -u -c -r1.31 command.h *** src/include/commands/command.h 2001/11/05 17:46:33 1.31 --- src/include/commands/command.h 2002/02/20 04:33:43 *************** *** 26,39 **** * BadArg if forward invalid. * "ERROR" if portal not found. */ ! extern void PerformPortalFetch(char *name, bool forward, int count, ! char *tag, CommandDest dest); /* * PerformPortalClose * Performs the POSTQUEL function CLOSE. */ ! extern void PerformPortalClose(char *name, CommandDest dest); extern void PortalCleanup(Portal portal); --- 26,39 ---- * BadArg if forward invalid. * "ERROR" if portal not found. */ ! extern void PerformPortalFetch(const char *name, bool forward, int count, ! CommandDest dest); /* * PerformPortalClose * Performs the POSTQUEL function CLOSE. */ ! extern void PerformPortalClose(const char *name); extern void PortalCleanup(Portal portal); Index: src/include/commands/rename.h =================================================================== RCS file: /projects/cvsroot/pgsql/src/include/commands/rename.h,v retrieving revision 1.13 diff -u -c -r1.13 rename.h *** src/include/commands/rename.h 2001/11/05 17:46:33 1.13 --- src/include/commands/rename.h 2002/02/20 04:33:43 *************** *** 14,22 **** #ifndef RENAME_H #define RENAME_H ! extern void renameatt(char *relname, ! char *oldattname, ! char *newattname, int recurse); extern void renamerel(const char *oldrelname, --- 14,22 ---- #ifndef RENAME_H #define RENAME_H ! extern void renameatt(const char *relname, ! const char *oldattname, ! const char *newattname, int recurse); extern void renamerel(const char *oldrelname, Index: src/include/tcop/dest.h =================================================================== RCS file: /projects/cvsroot/pgsql/src/include/tcop/dest.h,v retrieving revision 1.28 diff -u -c -r1.28 dest.h *** src/include/tcop/dest.h 2001/11/05 17:46:36 1.28 --- src/include/tcop/dest.h 2002/02/20 04:33:44 *************** *** 84,92 **** /* The primary destination management functions */ ! extern void BeginCommand(char *pname, int operation, TupleDesc attinfo, ! bool isIntoRel, bool isIntoPortal, char *tag, ! CommandDest dest); extern DestReceiver *DestToFunction(CommandDest dest); extern void EndCommand(char *commandTag, CommandDest dest); --- 84,91 ---- /* The primary destination management functions */ ! extern void BeginCommand(const char *pname, int operation, TupleDesc tupdesc, ! bool isIntoRel, bool isIntoPortal, CommandDest dest); extern DestReceiver *DestToFunction(CommandDest dest); extern void EndCommand(char *commandTag, CommandDest dest); Index: src/include/utils/portal.h =================================================================== RCS file: /projects/cvsroot/pgsql/src/include/utils/portal.h,v retrieving revision 1.32 diff -u -c -r1.32 portal.h *** src/include/utils/portal.h 2002/02/14 15:24:10 1.32 --- src/include/utils/portal.h 2002/02/20 04:33:44 *************** *** 62,70 **** extern void EnablePortalManager(void); extern void AtEOXact_portals(void); ! extern Portal CreatePortal(char *name); extern void PortalDrop(Portal portal); ! extern Portal GetPortalByName(char *name); extern void PortalSetQuery(Portal portal, QueryDesc *queryDesc, TupleDesc attinfo, EState *state, void (*cleanup) (Portal portal)); --- 62,70 ---- extern void EnablePortalManager(void); extern void AtEOXact_portals(void); ! extern Portal CreatePortal(const char *name); extern void PortalDrop(Portal portal); ! extern Portal GetPortalByName(const char *name); extern void PortalSetQuery(Portal portal, QueryDesc *queryDesc, TupleDesc attinfo, EState *state, void (*cleanup) (Portal portal));