aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-01-01 21:33:31 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-01-01 21:33:31 +0000
commit9315ff55492b1574db291556cd5d1513c703243e (patch)
tree83639a86b0b54e8a958988713c7d781ca661d10a /src
parent473763e67600c8d63699b4e783367bfbdddc24e4 (diff)
downloadpostgresql-9315ff55492b1574db291556cd5d1513c703243e.tar.gz
postgresql-9315ff55492b1574db291556cd5d1513c703243e.zip
Ensure attcacheoff is written out as -1 when writing pg_attribute
tuples for a relation. Needed to prevent Assert failure in CLUSTER.
Diffstat (limited to 'src')
-rw-r--r--src/backend/catalog/heap.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index abcc9951b4b..b869480fe30 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.155 2000/12/27 23:59:11 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.156 2001/01/01 21:33:31 tgl Exp $
*
*
* INTERFACE ROUTINES
@@ -590,8 +590,11 @@ AddNewAttributeTuples(Oid new_rel_oid,
dpp = tupdesc->attrs;
for (i = 0; i < natts; i++)
{
+ /* Fill in the correct relation OID */
(*dpp)->attrelid = new_rel_oid;
+ /* Make sure these are OK, too */
(*dpp)->attdispersion = 0;
+ (*dpp)->attcacheoff = -1;
tup = heap_addheader(Natts_pg_attribute,
ATTRIBUTE_TUPLE_SIZE,
@@ -613,8 +616,12 @@ AddNewAttributeTuples(Oid new_rel_oid,
dpp = HeapAtt;
for (i = 0; i < -1 - FirstLowInvalidHeapAttributeNumber; i++)
{
+ /* Fill in the correct relation OID */
+ /* HACK: we are writing on static data here */
(*dpp)->attrelid = new_rel_oid;
- /* (*dpp)->attdispersion = 0; unneeded */
+ /* Unneeded since they should be OK in the constant data anyway */
+ /* (*dpp)->attdispersion = 0; */
+ /* (*dpp)->attcacheoff = -1; */
tup = heap_addheader(Natts_pg_attribute,
ATTRIBUTE_TUPLE_SIZE,