diff options
Diffstat (limited to 'src/backend/access/common')
-rw-r--r-- | src/backend/access/common/heaptuple.c | 10 | ||||
-rw-r--r-- | src/backend/access/common/indextuple.c | 3 | ||||
-rw-r--r-- | src/backend/access/common/reloptions.c | 6 | ||||
-rw-r--r-- | src/backend/access/common/tupdesc.c | 16 |
4 files changed, 18 insertions, 17 deletions
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c index b7c864cfacf..f89769f3793 100644 --- a/src/backend/access/common/heaptuple.c +++ b/src/backend/access/common/heaptuple.c @@ -24,7 +24,7 @@ * that have been put into a tuple but never sent to disk. Hopefully there * are few such places. * - * Varlenas still have alignment 'i' (or 'd') in pg_type/pg_attribute, since + * Varlenas still have alignment INT (or DOUBLE) in pg_type/pg_attribute, since * that's the normal requirement for the untoasted format. But we ignore that * for the 1-byte-header format. This means that the actual start position * of a varlena datum may vary depending on which format it has. To determine @@ -39,7 +39,7 @@ * catalog, this is now risky: it's only safe if the preceding field is * word-aligned, so that there will never be any padding. * - * We don't pack varlenas whose attstorage is 'p', since the data type + * We don't pack varlenas whose attstorage is PLAIN, since the data type * isn't expecting to have to detoast values. This is used in particular * by oidvector and int2vector, which are used in the system catalogs * and we'd like to still refer to them via C struct offsets. @@ -66,10 +66,10 @@ /* Does att's datatype allow packing into the 1-byte-header varlena format? */ #define ATT_IS_PACKABLE(att) \ - ((att)->attlen == -1 && (att)->attstorage != 'p') + ((att)->attlen == -1 && (att)->attstorage != TYPSTORAGE_PLAIN) /* Use this if it's already known varlena */ #define VARLENA_ATT_IS_PACKABLE(att) \ - ((att)->attstorage != 'p') + ((att)->attstorage != TYPSTORAGE_PLAIN) /* ---------------------------------------------------------------- @@ -274,7 +274,7 @@ fill_val(Form_pg_attribute att, { /* cstring ... never needs alignment */ *infomask |= HEAP_HASVARWIDTH; - Assert(att->attalign == 'c'); + Assert(att->attalign == TYPALIGN_CHAR); data_length = strlen(DatumGetCString(datum)) + 1; memcpy(data, DatumGetPointer(datum), data_length); } diff --git a/src/backend/access/common/indextuple.c b/src/backend/access/common/indextuple.c index bfc8b154a7a..634016b9b7c 100644 --- a/src/backend/access/common/indextuple.c +++ b/src/backend/access/common/indextuple.c @@ -100,7 +100,8 @@ index_form_tuple(TupleDesc tupleDescriptor, */ if (!VARATT_IS_EXTENDED(DatumGetPointer(untoasted_values[i])) && VARSIZE(DatumGetPointer(untoasted_values[i])) > TOAST_INDEX_TARGET && - (att->attstorage == 'x' || att->attstorage == 'm')) + (att->attstorage == TYPSTORAGE_EXTENDED || + att->attstorage == TYPSTORAGE_MAIN)) { Datum cvalue = toast_compress_datum(untoasted_values[i]); diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index 5325dd3f611..c3d45c7a248 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -892,7 +892,7 @@ transformRelOptions(Datum oldOptions, List *defList, const char *namspace, int noldoptions; int i; - deconstruct_array(array, TEXTOID, -1, false, 'i', + deconstruct_array(array, TEXTOID, -1, false, TYPALIGN_INT, &oldoptions, NULL, &noldoptions); for (i = 0; i < noldoptions; i++) @@ -1060,7 +1060,7 @@ untransformRelOptions(Datum options) array = DatumGetArrayTypeP(options); - deconstruct_array(array, TEXTOID, -1, false, 'i', + deconstruct_array(array, TEXTOID, -1, false, TYPALIGN_INT, &optiondatums, NULL, &noptions); for (i = 0; i < noptions; i++) @@ -1201,7 +1201,7 @@ parseRelOptions(Datum options, bool validate, relopt_kind kind, Datum *optiondatums; int noptions; - deconstruct_array(array, TEXTOID, -1, false, 'i', + deconstruct_array(array, TEXTOID, -1, false, TYPALIGN_INT, &optiondatums, NULL, &noptions); for (i = 0; i < noptions; i++) diff --git a/src/backend/access/common/tupdesc.c b/src/backend/access/common/tupdesc.c index 28835512f00..1e743d7d86e 100644 --- a/src/backend/access/common/tupdesc.c +++ b/src/backend/access/common/tupdesc.c @@ -725,32 +725,32 @@ TupleDescInitBuiltinEntry(TupleDesc desc, case TEXTARRAYOID: att->attlen = -1; att->attbyval = false; - att->attalign = 'i'; - att->attstorage = 'x'; + att->attalign = TYPALIGN_INT; + att->attstorage = TYPSTORAGE_EXTENDED; att->attcollation = DEFAULT_COLLATION_OID; break; case BOOLOID: att->attlen = 1; att->attbyval = true; - att->attalign = 'c'; - att->attstorage = 'p'; + att->attalign = TYPALIGN_CHAR; + att->attstorage = TYPSTORAGE_PLAIN; att->attcollation = InvalidOid; break; case INT4OID: att->attlen = 4; att->attbyval = true; - att->attalign = 'i'; - att->attstorage = 'p'; + att->attalign = TYPALIGN_INT; + att->attstorage = TYPSTORAGE_PLAIN; att->attcollation = InvalidOid; break; case INT8OID: att->attlen = 8; att->attbyval = FLOAT8PASSBYVAL; - att->attalign = 'd'; - att->attstorage = 'p'; + att->attalign = TYPALIGN_DOUBLE; + att->attstorage = TYPSTORAGE_PLAIN; att->attcollation = InvalidOid; break; |