Skip to content

Commit 9315ff5

Browse files
committed
Ensure attcacheoff is written out as -1 when writing pg_attribute
tuples for a relation. Needed to prevent Assert failure in CLUSTER.
1 parent 473763e commit 9315ff5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/backend/catalog/heap.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.155 2000/12/27 23:59:11 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.156 2001/01/01 21:33:31 tgl Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -590,8 +590,11 @@ AddNewAttributeTuples(Oid new_rel_oid,
590590
dpp = tupdesc->attrs;
591591
for (i = 0; i < natts; i++)
592592
{
593+
/* Fill in the correct relation OID */
593594
(*dpp)->attrelid = new_rel_oid;
595+
/* Make sure these are OK, too */
594596
(*dpp)->attdispersion = 0;
597+
(*dpp)->attcacheoff = -1;
595598

596599
tup = heap_addheader(Natts_pg_attribute,
597600
ATTRIBUTE_TUPLE_SIZE,
@@ -613,8 +616,12 @@ AddNewAttributeTuples(Oid new_rel_oid,
613616
dpp = HeapAtt;
614617
for (i = 0; i < -1 - FirstLowInvalidHeapAttributeNumber; i++)
615618
{
619+
/* Fill in the correct relation OID */
620+
/* HACK: we are writing on static data here */
616621
(*dpp)->attrelid = new_rel_oid;
617-
/* (*dpp)->attdispersion = 0; unneeded */
622+
/* Unneeded since they should be OK in the constant data anyway */
623+
/* (*dpp)->attdispersion = 0; */
624+
/* (*dpp)->attcacheoff = -1; */
618625

619626
tup = heap_addheader(Natts_pg_attribute,
620627
ATTRIBUTE_TUPLE_SIZE,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy