*** pgsql/src/backend/bootstrap/bootstrap.c 2009/01/01 17:23:36 1.248 --- pgsql/src/backend/bootstrap/bootstrap.c 2009/01/22 20:16:00 1.249 *************** *** 8,14 **** * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.247 2008/11/02 01:45:27 tgl Exp $ * *------------------------------------------------------------------------- */ --- 8,14 ---- * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.248 2009/01/01 17:23:36 momjian Exp $ * *------------------------------------------------------------------------- */ *************** boot_openrel(char *relname) *** 633,639 **** closerel(NULL); elog(DEBUG4, "open relation %s, attrsize %d", ! relname, (int) ATTRIBUTE_TUPLE_SIZE); boot_reldesc = heap_openrv(makeRangeVar(NULL, relname, -1), NoLock); numattr = boot_reldesc->rd_rel->relnatts; --- 633,639 ---- closerel(NULL); elog(DEBUG4, "open relation %s, attrsize %d", ! relname, (int) ATTRIBUTE_FIXED_PART_SIZE); boot_reldesc = heap_openrv(makeRangeVar(NULL, relname, -1), NoLock); numattr = boot_reldesc->rd_rel->relnatts; *************** boot_openrel(char *relname) *** 643,649 **** attrtypes[i] = AllocateAttribute(); memmove((char *) attrtypes[i], (char *) boot_reldesc->rd_att->attrs[i], ! ATTRIBUTE_TUPLE_SIZE); { Form_pg_attribute at = attrtypes[i]; --- 643,649 ---- attrtypes[i] = AllocateAttribute(); memmove((char *) attrtypes[i], (char *) boot_reldesc->rd_att->attrs[i], ! ATTRIBUTE_FIXED_PART_SIZE); { Form_pg_attribute at = attrtypes[i]; *************** DefineAttr(char *name, char *type, int a *** 709,715 **** if (attrtypes[attnum] == NULL) attrtypes[attnum] = AllocateAttribute(); ! MemSet(attrtypes[attnum], 0, ATTRIBUTE_TUPLE_SIZE); namestrcpy(&attrtypes[attnum]->attname, name); elog(DEBUG4, "column %s %s", NameStr(attrtypes[attnum]->attname), type); --- 709,715 ---- if (attrtypes[attnum] == NULL) attrtypes[attnum] = AllocateAttribute(); ! MemSet(attrtypes[attnum], 0, ATTRIBUTE_FIXED_PART_SIZE); namestrcpy(&attrtypes[attnum]->attname, name); elog(DEBUG4, "column %s %s", NameStr(attrtypes[attnum]->attname), type); *************** boot_get_type_io_data(Oid typid, *** 1017,1032 **** /* ---------------- * AllocateAttribute * ---------------- */ static Form_pg_attribute AllocateAttribute(void) { ! Form_pg_attribute attribute = (Form_pg_attribute) malloc(ATTRIBUTE_TUPLE_SIZE); if (!PointerIsValid(attribute)) elog(FATAL, "out of memory"); ! MemSet(attribute, 0, ATTRIBUTE_TUPLE_SIZE); return attribute; } --- 1017,1035 ---- /* ---------------- * AllocateAttribute + * + * Note: bootstrap never sets any per-column ACLs, so we only need + * ATTRIBUTE_FIXED_PART_SIZE space per attribute. * ---------------- */ static Form_pg_attribute AllocateAttribute(void) { ! Form_pg_attribute attribute = (Form_pg_attribute) malloc(ATTRIBUTE_FIXED_PART_SIZE); if (!PointerIsValid(attribute)) elog(FATAL, "out of memory"); ! MemSet(attribute, 0, ATTRIBUTE_FIXED_PART_SIZE); return attribute; }