diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-09-02 01:05:06 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-09-02 01:05:06 +0000 |
commit | c7a165adc64e3e67e0dcee4088d84a0638b3515a (patch) | |
tree | 97d02a63e6ab6a516cb8e8ba24b0ba42782d202d /src/backend/commands/tablecmds.c | |
parent | fcd34f9f7ff561213beef97f93c32f415e35a79c (diff) | |
download | postgresql-c7a165adc64e3e67e0dcee4088d84a0638b3515a.tar.gz postgresql-c7a165adc64e3e67e0dcee4088d84a0638b3515a.zip |
Code review for HeapTupleHeader changes. Add version number to page headers
(overlaying low byte of page size) and add HEAP_HASOID bit to t_infomask,
per earlier discussion. Simplify scheme for overlaying fields in tuple
header (no need for cmax to live in more than one place). Don't try to
clear infomask status bits in tqual.c --- not safe to do it there. Don't
try to force output table of a SELECT INTO to have OIDs, either. Get rid
of unnecessarily complex three-state scheme for TupleDesc.tdhasoids, which
has already caused one recent failure. Improve documentation.
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r-- | src/backend/commands/tablecmds.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 8529c15fdb5..8709111a860 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.37 2002/08/30 19:23:19 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.38 2002/09/02 01:05:04 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -150,7 +150,8 @@ DefineRelation(CreateStmt *stmt, char relkind) * have to copy inherited constraints here.) */ descriptor = BuildDescForRelation(schema); - descriptor->tdhasoid = BoolToHasOid(stmt->hasoids || parentHasOids); + + descriptor->tdhasoid = (stmt->hasoids || parentHasOids); if (old_constraints != NIL) { @@ -212,7 +213,6 @@ DefineRelation(CreateStmt *stmt, char relkind) descriptor, relkind, false, - stmt->hasoids || parentHasOids, allowSystemTableMods); StoreCatalogInheritance(relationId, inheritOids); @@ -1733,7 +1733,6 @@ AlterTableAddColumn(Oid myrelid, ReleaseSysCache(typeTuple); - AssertTupleDescHasNoOid(attrdesc->rd_att); simple_heap_insert(attrdesc, attributeTuple); /* Update indexes on pg_attribute */ @@ -1747,7 +1746,7 @@ AlterTableAddColumn(Oid myrelid, newreltup = heap_copytuple(reltup); ((Form_pg_class) GETSTRUCT(newreltup))->relnatts = maxatts; - AssertTupleDescHasOid(pgclass->rd_att); + simple_heap_update(pgclass, &newreltup->t_self, newreltup); /* keep catalog indexes current */ @@ -3430,7 +3429,7 @@ AlterTableCreateToastTable(Oid relOid, bool silent) snprintf(toast_idxname, NAMEDATALEN, "pg_toast_%u_index", relOid); /* this is pretty painful... need a tuple descriptor */ - tupdesc = CreateTemplateTupleDesc(3, WITHOUTOID); + tupdesc = CreateTemplateTupleDesc(3, false); TupleDescInitEntry(tupdesc, (AttrNumber) 1, "chunk_id", OIDOID, @@ -3464,7 +3463,6 @@ AlterTableCreateToastTable(Oid relOid, bool silent) tupdesc, RELKIND_TOASTVALUE, shared_relation, - false, true); /* make the toast relation visible, else index creation will fail */ |