diff options
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r-- | src/backend/utils/adt/arrayutils.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/enum.c | 3 | ||||
-rw-r--r-- | src/backend/utils/adt/float.c | 10 | ||||
-rw-r--r-- | src/backend/utils/adt/format_type.c | 3 | ||||
-rw-r--r-- | src/backend/utils/adt/json.c | 6 | ||||
-rw-r--r-- | src/backend/utils/adt/jsonb.c | 6 | ||||
-rw-r--r-- | src/backend/utils/adt/jsonb_gin.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/jsonb_op.c | 8 | ||||
-rw-r--r-- | src/backend/utils/adt/jsonfuncs.c | 12 | ||||
-rw-r--r-- | src/backend/utils/adt/lockfuncs.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/name.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/orderedsetaggs.c | 10 | ||||
-rw-r--r-- | src/backend/utils/adt/pg_upgrade_support.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/rangetypes.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/regexp.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/ruleutils.c | 10 | ||||
-rw-r--r-- | src/backend/utils/adt/timestamp.c | 16 | ||||
-rw-r--r-- | src/backend/utils/adt/tsvector_op.c | 14 | ||||
-rw-r--r-- | src/backend/utils/adt/varlena.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/xml.c | 2 |
20 files changed, 62 insertions, 58 deletions
diff --git a/src/backend/utils/adt/arrayutils.c b/src/backend/utils/adt/arrayutils.c index d972be17f9..bc4360aaec 100644 --- a/src/backend/utils/adt/arrayutils.c +++ b/src/backend/utils/adt/arrayutils.c @@ -220,7 +220,7 @@ ArrayGetIntegerTypmods(ArrayType *arr, int *n) /* hardwired knowledge about cstring's representation details here */ deconstruct_array(arr, CSTRINGOID, - -2, false, 'c', + -2, false, TYPALIGN_CHAR, &elem_values, NULL, n); result = (int32 *) palloc(*n * sizeof(int32)); diff --git a/src/backend/utils/adt/enum.c b/src/backend/utils/adt/enum.c index 3ea0d5d31d..5ead794e34 100644 --- a/src/backend/utils/adt/enum.c +++ b/src/backend/utils/adt/enum.c @@ -602,7 +602,8 @@ enum_range_internal(Oid enumtypoid, Oid lower, Oid upper) /* and build the result array */ /* note this hardwires some details about the representation of Oid */ - result = construct_array(elems, cnt, enumtypoid, sizeof(Oid), true, 'i'); + result = construct_array(elems, cnt, enumtypoid, + sizeof(Oid), true, TYPALIGN_INT); pfree(elems); diff --git a/src/backend/utils/adt/float.c b/src/backend/utils/adt/float.c index 34af0eb22b..2101d58674 100644 --- a/src/backend/utils/adt/float.c +++ b/src/backend/utils/adt/float.c @@ -2878,7 +2878,7 @@ float8_combine(PG_FUNCTION_ARGS) result = construct_array(transdatums, 3, FLOAT8OID, - sizeof(float8), FLOAT8PASSBYVAL, 'd'); + sizeof(float8), FLOAT8PASSBYVAL, TYPALIGN_DOUBLE); PG_RETURN_ARRAYTYPE_P(result); } @@ -2950,7 +2950,7 @@ float8_accum(PG_FUNCTION_ARGS) result = construct_array(transdatums, 3, FLOAT8OID, - sizeof(float8), FLOAT8PASSBYVAL, 'd'); + sizeof(float8), FLOAT8PASSBYVAL, TYPALIGN_DOUBLE); PG_RETURN_ARRAYTYPE_P(result); } @@ -3024,7 +3024,7 @@ float4_accum(PG_FUNCTION_ARGS) result = construct_array(transdatums, 3, FLOAT8OID, - sizeof(float8), FLOAT8PASSBYVAL, 'd'); + sizeof(float8), FLOAT8PASSBYVAL, TYPALIGN_DOUBLE); PG_RETURN_ARRAYTYPE_P(result); } @@ -3256,7 +3256,7 @@ float8_regr_accum(PG_FUNCTION_ARGS) result = construct_array(transdatums, 6, FLOAT8OID, - sizeof(float8), FLOAT8PASSBYVAL, 'd'); + sizeof(float8), FLOAT8PASSBYVAL, TYPALIGN_DOUBLE); PG_RETURN_ARRAYTYPE_P(result); } @@ -3397,7 +3397,7 @@ float8_regr_combine(PG_FUNCTION_ARGS) result = construct_array(transdatums, 6, FLOAT8OID, - sizeof(float8), FLOAT8PASSBYVAL, 'd'); + sizeof(float8), FLOAT8PASSBYVAL, TYPALIGN_DOUBLE); PG_RETURN_ARRAYTYPE_P(result); } diff --git a/src/backend/utils/adt/format_type.c b/src/backend/utils/adt/format_type.c index 92ee77ac5c..df0bdeb610 100644 --- a/src/backend/utils/adt/format_type.c +++ b/src/backend/utils/adt/format_type.c @@ -136,7 +136,8 @@ format_type_extended(Oid type_oid, int32 typemod, bits16 flags) */ array_base_type = typeform->typelem; - if (array_base_type != InvalidOid && typeform->typstorage != 'p') + if (array_base_type != InvalidOid && + typeform->typstorage != TYPSTORAGE_PLAIN) { /* Switch our attention to the array element type */ ReleaseSysCache(tuple); diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c index 567eab1e01..f78420e22d 100644 --- a/src/backend/utils/adt/json.c +++ b/src/backend/utils/adt/json.c @@ -1142,7 +1142,7 @@ json_object(PG_FUNCTION_ARGS) } deconstruct_array(in_array, - TEXTOID, -1, false, 'i', + TEXTOID, -1, false, TYPALIGN_INT, &in_datums, &in_nulls, &in_count); count = in_count / 2; @@ -1219,11 +1219,11 @@ json_object_two_arg(PG_FUNCTION_ARGS) PG_RETURN_DATUM(CStringGetTextDatum("{}")); deconstruct_array(key_array, - TEXTOID, -1, false, 'i', + TEXTOID, -1, false, TYPALIGN_INT, &key_datums, &key_nulls, &key_count); deconstruct_array(val_array, - TEXTOID, -1, false, 'i', + TEXTOID, -1, false, TYPALIGN_INT, &val_datums, &val_nulls, &val_count); if (key_count != val_count) diff --git a/src/backend/utils/adt/jsonb.c b/src/backend/utils/adt/jsonb.c index fea4335951..b961d29472 100644 --- a/src/backend/utils/adt/jsonb.c +++ b/src/backend/utils/adt/jsonb.c @@ -1317,7 +1317,7 @@ jsonb_object(PG_FUNCTION_ARGS) } deconstruct_array(in_array, - TEXTOID, -1, false, 'i', + TEXTOID, -1, false, TYPALIGN_INT, &in_datums, &in_nulls, &in_count); count = in_count / 2; @@ -1405,11 +1405,11 @@ jsonb_object_two_arg(PG_FUNCTION_ARGS) goto close_object; deconstruct_array(key_array, - TEXTOID, -1, false, 'i', + TEXTOID, -1, false, TYPALIGN_INT, &key_datums, &key_nulls, &key_count); deconstruct_array(val_array, - TEXTOID, -1, false, 'i', + TEXTOID, -1, false, TYPALIGN_INT, &val_datums, &val_nulls, &val_count); if (key_count != val_count) diff --git a/src/backend/utils/adt/jsonb_gin.c b/src/backend/utils/adt/jsonb_gin.c index 63122edf2e..aee3d9d673 100644 --- a/src/backend/utils/adt/jsonb_gin.c +++ b/src/backend/utils/adt/jsonb_gin.c @@ -886,7 +886,7 @@ gin_extract_jsonb_query(PG_FUNCTION_ARGS) j; deconstruct_array(query, - TEXTOID, -1, false, 'i', + TEXTOID, -1, false, TYPALIGN_INT, &key_datums, &key_nulls, &key_count); entries = (Datum *) palloc(sizeof(Datum) * key_count); diff --git a/src/backend/utils/adt/jsonb_op.c b/src/backend/utils/adt/jsonb_op.c index 443ea24dc6..dc17e17f9b 100644 --- a/src/backend/utils/adt/jsonb_op.c +++ b/src/backend/utils/adt/jsonb_op.c @@ -53,8 +53,8 @@ jsonb_exists_any(PG_FUNCTION_ARGS) bool *key_nulls; int elem_count; - deconstruct_array(keys, TEXTOID, -1, false, 'i', &key_datums, &key_nulls, - &elem_count); + deconstruct_array(keys, TEXTOID, -1, false, TYPALIGN_INT, + &key_datums, &key_nulls, &elem_count); for (i = 0; i < elem_count; i++) { @@ -86,8 +86,8 @@ jsonb_exists_all(PG_FUNCTION_ARGS) bool *key_nulls; int elem_count; - deconstruct_array(keys, TEXTOID, -1, false, 'i', &key_datums, &key_nulls, - &elem_count); + deconstruct_array(keys, TEXTOID, -1, false, TYPALIGN_INT, + &key_datums, &key_nulls, &elem_count); for (i = 0; i < elem_count; i++) { diff --git a/src/backend/utils/adt/jsonfuncs.c b/src/backend/utils/adt/jsonfuncs.c index 6e33dfb2a2..f92861d8d2 100644 --- a/src/backend/utils/adt/jsonfuncs.c +++ b/src/backend/utils/adt/jsonfuncs.c @@ -1019,7 +1019,7 @@ get_path_all(FunctionCallInfo fcinfo, bool as_text) if (array_contains_nulls(path)) PG_RETURN_NULL(); - deconstruct_array(path, TEXTOID, -1, false, 'i', + deconstruct_array(path, TEXTOID, -1, false, TYPALIGN_INT, &pathtext, &pathnulls, &npath); tpath = palloc(npath * sizeof(char *)); @@ -1479,7 +1479,7 @@ get_jsonb_path_all(FunctionCallInfo fcinfo, bool as_text) if (array_contains_nulls(path)) PG_RETURN_NULL(); - deconstruct_array(path, TEXTOID, -1, false, 'i', + deconstruct_array(path, TEXTOID, -1, false, TYPALIGN_INT, &pathtext, &pathnulls, &npath); /* Identify whether we have object, array, or scalar at top-level */ @@ -4361,7 +4361,7 @@ jsonb_delete_array(PG_FUNCTION_ARGS) if (JB_ROOT_COUNT(in) == 0) PG_RETURN_JSONB_P(in); - deconstruct_array(keys, TEXTOID, -1, false, 'i', + deconstruct_array(keys, TEXTOID, -1, false, TYPALIGN_INT, &keys_elems, &keys_nulls, &keys_len); if (keys_len == 0) @@ -4511,7 +4511,7 @@ jsonb_set(PG_FUNCTION_ARGS) if (JB_ROOT_COUNT(in) == 0 && !create) PG_RETURN_JSONB_P(in); - deconstruct_array(path, TEXTOID, -1, false, 'i', + deconstruct_array(path, TEXTOID, -1, false, TYPALIGN_INT, &path_elems, &path_nulls, &path_len); if (path_len == 0) @@ -4622,7 +4622,7 @@ jsonb_delete_path(PG_FUNCTION_ARGS) if (JB_ROOT_COUNT(in) == 0) PG_RETURN_JSONB_P(in); - deconstruct_array(path, TEXTOID, -1, false, 'i', + deconstruct_array(path, TEXTOID, -1, false, TYPALIGN_INT, &path_elems, &path_nulls, &path_len); if (path_len == 0) @@ -4665,7 +4665,7 @@ jsonb_insert(PG_FUNCTION_ARGS) (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("cannot set path in scalar"))); - deconstruct_array(path, TEXTOID, -1, false, 'i', + deconstruct_array(path, TEXTOID, -1, false, TYPALIGN_INT, &path_elems, &path_nulls, &path_len); if (path_len == 0) diff --git a/src/backend/utils/adt/lockfuncs.c b/src/backend/utils/adt/lockfuncs.c index 7e47ebeb6f..ecb1bf92ff 100644 --- a/src/backend/utils/adt/lockfuncs.c +++ b/src/backend/utils/adt/lockfuncs.c @@ -519,7 +519,7 @@ pg_blocking_pids(PG_FUNCTION_ARGS) /* Construct array, using hardwired knowledge about int4 type */ PG_RETURN_ARRAYTYPE_P(construct_array(arrayelems, narrayelems, INT4OID, - sizeof(int32), true, 'i')); + sizeof(int32), true, TYPALIGN_INT)); } @@ -560,7 +560,7 @@ pg_safe_snapshot_blocking_pids(PG_FUNCTION_ARGS) /* Construct array, using hardwired knowledge about int4 type */ PG_RETURN_ARRAYTYPE_P(construct_array(blocker_datums, num_blockers, INT4OID, - sizeof(int32), true, 'i')); + sizeof(int32), true, TYPALIGN_INT)); } diff --git a/src/backend/utils/adt/name.c b/src/backend/utils/adt/name.c index 6749e75c89..64877f67e0 100644 --- a/src/backend/utils/adt/name.c +++ b/src/backend/utils/adt/name.c @@ -358,7 +358,7 @@ current_schemas(PG_FUNCTION_ARGS) NAMEOID, NAMEDATALEN, /* sizeof(Name) */ false, /* Name is not by-val */ - 'c'); /* alignment of Name */ + TYPALIGN_CHAR); /* alignment of Name */ PG_RETURN_POINTER(array); } diff --git a/src/backend/utils/adt/orderedsetaggs.c b/src/backend/utils/adt/orderedsetaggs.c index d169045a1a..f9b5d7024b 100644 --- a/src/backend/utils/adt/orderedsetaggs.c +++ b/src/backend/utils/adt/orderedsetaggs.c @@ -755,7 +755,7 @@ percentile_disc_multi_final(PG_FUNCTION_ARGS) deconstruct_array(param, FLOAT8OID, /* hard-wired info on type float8 */ - 8, FLOAT8PASSBYVAL, 'd', + sizeof(float8), FLOAT8PASSBYVAL, TYPALIGN_DOUBLE, &percentiles_datum, &percentiles_null, &num_percentiles); @@ -879,7 +879,7 @@ percentile_cont_multi_final_common(FunctionCallInfo fcinfo, deconstruct_array(param, FLOAT8OID, /* hard-wired info on type float8 */ - 8, FLOAT8PASSBYVAL, 'd', + sizeof(float8), FLOAT8PASSBYVAL, TYPALIGN_DOUBLE, &percentiles_datum, &percentiles_null, &num_percentiles); @@ -1002,7 +1002,9 @@ percentile_cont_float8_multi_final(PG_FUNCTION_ARGS) return percentile_cont_multi_final_common(fcinfo, FLOAT8OID, /* hard-wired info on type float8 */ - 8, FLOAT8PASSBYVAL, 'd', + sizeof(float8), + FLOAT8PASSBYVAL, + TYPALIGN_DOUBLE, float8_lerp); } @@ -1015,7 +1017,7 @@ percentile_cont_interval_multi_final(PG_FUNCTION_ARGS) return percentile_cont_multi_final_common(fcinfo, INTERVALOID, /* hard-wired info on type interval */ - 16, false, 'd', + 16, false, TYPALIGN_DOUBLE, interval_lerp); } diff --git a/src/backend/utils/adt/pg_upgrade_support.c b/src/backend/utils/adt/pg_upgrade_support.c index 0d9e55cdcf..18f2ee8226 100644 --- a/src/backend/utils/adt/pg_upgrade_support.c +++ b/src/backend/utils/adt/pg_upgrade_support.c @@ -160,7 +160,7 @@ binary_upgrade_create_empty_extension(PG_FUNCTION_ARGS) int i; deconstruct_array(textArray, - TEXTOID, -1, false, 'i', + TEXTOID, -1, false, TYPALIGN_INT, &textDatums, NULL, &ndatums); for (i = 0; i < ndatums; i++) { diff --git a/src/backend/utils/adt/rangetypes.c b/src/backend/utils/adt/rangetypes.c index b95132b714..490bc2ae81 100644 --- a/src/backend/utils/adt/rangetypes.c +++ b/src/backend/utils/adt/rangetypes.c @@ -2389,7 +2389,7 @@ range_contains_elem_internal(TypeCacheEntry *typcache, const RangeType *r, Datum /* Does datatype allow packing into the 1-byte-header varlena format? */ #define TYPE_IS_PACKABLE(typlen, typstorage) \ - ((typlen) == -1 && (typstorage) != 'p') + ((typlen) == -1 && (typstorage) != TYPSTORAGE_PLAIN) /* * Increment data_length by the space needed by the datum, including any @@ -2473,7 +2473,7 @@ datum_write(Pointer ptr, Datum datum, bool typbyval, char typalign, else if (typlen == -2) { /* cstring ... never needs alignment */ - Assert(typalign == 'c'); + Assert(typalign == TYPALIGN_CHAR); data_length = strlen(DatumGetCString(datum)) + 1; memcpy(ptr, DatumGetPointer(datum), data_length); } diff --git a/src/backend/utils/adt/regexp.c b/src/backend/utils/adt/regexp.c index 6c76e89c9a..06f808652a 100644 --- a/src/backend/utils/adt/regexp.c +++ b/src/backend/utils/adt/regexp.c @@ -1329,7 +1329,7 @@ build_regexp_match_result(regexp_matches_ctx *matchctx) lbs[0] = 1; /* XXX: this hardcodes assumptions about the text type */ return construct_md_array(elems, nulls, 1, dims, lbs, - TEXTOID, -1, false, 'i'); + TEXTOID, -1, false, TYPALIGN_INT); } /* diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 158784474d..5e63238f03 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -2154,7 +2154,7 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand, elog(ERROR, "null indkey for index %u", indexId); deconstruct_array(DatumGetArrayTypeP(cols), - INT2OID, 2, true, 's', + INT2OID, 2, true, TYPALIGN_SHORT, &keys, NULL, &nKeys); for (j = keyatts; j < nKeys; j++) @@ -2279,7 +2279,7 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand, constraintId); deconstruct_array(DatumGetArrayTypeP(val), - OIDOID, sizeof(Oid), true, 'i', + OIDOID, sizeof(Oid), true, TYPALIGN_INT, &elems, NULL, &nElems); operators = (Oid *) palloc(nElems * sizeof(Oid)); @@ -2335,7 +2335,7 @@ decompile_column_index_array(Datum column_index_array, Oid relId, /* Extract data from array of int16 */ deconstruct_array(DatumGetArrayTypeP(column_index_array), - INT2OID, 2, true, 's', + INT2OID, 2, true, TYPALIGN_SHORT, &keys, NULL, &nKeys); for (j = 0; j < nKeys; j++) @@ -2730,7 +2730,7 @@ pg_get_functiondef(PG_FUNCTION_ARGS) -1 /* varlenarray */ , -1 /* TEXT's typlen */ , false /* TEXT's typbyval */ , - 'i' /* TEXT's typalign */ , + TYPALIGN_INT /* TEXT's typalign */ , &isnull); if (!isnull) { @@ -11277,7 +11277,7 @@ flatten_reloptions(Oid relid) initStringInfo(&buf); deconstruct_array(DatumGetArrayTypeP(reloptions), - TEXTOID, -1, false, 'i', + TEXTOID, -1, false, TYPALIGN_INT, &options, NULL, &noptions); for (i = 0; i < noptions; i++) diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c index 0b6c9d5ea8..4caffb5804 100644 --- a/src/backend/utils/adt/timestamp.c +++ b/src/backend/utils/adt/timestamp.c @@ -3421,7 +3421,7 @@ interval_accum(PG_FUNCTION_ARGS) ArrayType *result; deconstruct_array(transarray, - INTERVALOID, sizeof(Interval), false, 'd', + INTERVALOID, sizeof(Interval), false, TYPALIGN_DOUBLE, &transdatums, NULL, &ndatums); if (ndatums != 2) elog(ERROR, "expected 2-element interval array"); @@ -3438,7 +3438,7 @@ interval_accum(PG_FUNCTION_ARGS) transdatums[1] = IntervalPGetDatum(&N); result = construct_array(transdatums, 2, - INTERVALOID, sizeof(Interval), false, 'd'); + INTERVALOID, sizeof(Interval), false, TYPALIGN_DOUBLE); PG_RETURN_ARRAYTYPE_P(result); } @@ -3461,7 +3461,7 @@ interval_combine(PG_FUNCTION_ARGS) ArrayType *result; deconstruct_array(transarray1, - INTERVALOID, sizeof(Interval), false, 'd', + INTERVALOID, sizeof(Interval), false, TYPALIGN_DOUBLE, &transdatums1, NULL, &ndatums1); if (ndatums1 != 2) elog(ERROR, "expected 2-element interval array"); @@ -3470,7 +3470,7 @@ interval_combine(PG_FUNCTION_ARGS) N1 = *(DatumGetIntervalP(transdatums1[1])); deconstruct_array(transarray2, - INTERVALOID, sizeof(Interval), false, 'd', + INTERVALOID, sizeof(Interval), false, TYPALIGN_DOUBLE, &transdatums2, NULL, &ndatums2); if (ndatums2 != 2) elog(ERROR, "expected 2-element interval array"); @@ -3487,7 +3487,7 @@ interval_combine(PG_FUNCTION_ARGS) transdatums1[1] = IntervalPGetDatum(&N1); result = construct_array(transdatums1, 2, - INTERVALOID, sizeof(Interval), false, 'd'); + INTERVALOID, sizeof(Interval), false, TYPALIGN_DOUBLE); PG_RETURN_ARRAYTYPE_P(result); } @@ -3505,7 +3505,7 @@ interval_accum_inv(PG_FUNCTION_ARGS) ArrayType *result; deconstruct_array(transarray, - INTERVALOID, sizeof(Interval), false, 'd', + INTERVALOID, sizeof(Interval), false, TYPALIGN_DOUBLE, &transdatums, NULL, &ndatums); if (ndatums != 2) elog(ERROR, "expected 2-element interval array"); @@ -3522,7 +3522,7 @@ interval_accum_inv(PG_FUNCTION_ARGS) transdatums[1] = IntervalPGetDatum(&N); result = construct_array(transdatums, 2, - INTERVALOID, sizeof(Interval), false, 'd'); + INTERVALOID, sizeof(Interval), false, TYPALIGN_DOUBLE); PG_RETURN_ARRAYTYPE_P(result); } @@ -3537,7 +3537,7 @@ interval_avg(PG_FUNCTION_ARGS) N; deconstruct_array(transarray, - INTERVALOID, sizeof(Interval), false, 'd', + INTERVALOID, sizeof(Interval), false, TYPALIGN_DOUBLE, &transdatums, NULL, &ndatums); if (ndatums != 2) elog(ERROR, "expected 2-element interval array"); diff --git a/src/backend/utils/adt/tsvector_op.c b/src/backend/utils/adt/tsvector_op.c index cab6874e70..790355082d 100644 --- a/src/backend/utils/adt/tsvector_op.c +++ b/src/backend/utils/adt/tsvector_op.c @@ -303,7 +303,7 @@ tsvector_setweight_by_filter(PG_FUNCTION_ARGS) memcpy(tsout, tsin, VARSIZE(tsin)); entry = ARRPTR(tsout); - deconstruct_array(lexemes, TEXTOID, -1, false, 'i', + deconstruct_array(lexemes, TEXTOID, -1, false, TYPALIGN_INT, &dlexemes, &nulls, &nlexemes); /* @@ -582,7 +582,7 @@ tsvector_delete_arr(PG_FUNCTION_ARGS) Datum *dlexemes; bool *nulls; - deconstruct_array(lexemes, TEXTOID, -1, false, 'i', + deconstruct_array(lexemes, TEXTOID, -1, false, TYPALIGN_INT, &dlexemes, &nulls, &nlex); /* @@ -692,9 +692,9 @@ tsvector_unnest(PG_FUNCTION_ARGS) } values[1] = PointerGetDatum(construct_array(positions, posv->npos, - INT2OID, 2, true, 's')); + INT2OID, 2, true, TYPALIGN_SHORT)); values[2] = PointerGetDatum(construct_array(weights, posv->npos, - TEXTOID, -1, false, 'i')); + TEXTOID, -1, false, TYPALIGN_INT)); } else { @@ -731,7 +731,7 @@ tsvector_to_array(PG_FUNCTION_ARGS) arrin[i].len)); } - array = construct_array(elements, tsin->size, TEXTOID, -1, false, 'i'); + array = construct_array(elements, tsin->size, TEXTOID, -1, false, TYPALIGN_INT); pfree(elements); PG_FREE_IF_COPY(tsin, 0); @@ -755,7 +755,7 @@ array_to_tsvector(PG_FUNCTION_ARGS) datalen = 0; char *cur; - deconstruct_array(v, TEXTOID, -1, false, 'i', &dlexemes, &nulls, &nitems); + deconstruct_array(v, TEXTOID, -1, false, TYPALIGN_INT, &dlexemes, &nulls, &nitems); /* Reject nulls (maybe we should just ignore them, instead?) */ for (i = 0; i < nitems; i++) @@ -823,7 +823,7 @@ tsvector_filter(PG_FUNCTION_ARGS) int cur_pos = 0; char mask = 0; - deconstruct_array(weights, CHAROID, 1, true, 'c', + deconstruct_array(weights, CHAROID, 1, true, TYPALIGN_CHAR, &dweights, &nulls, &nweights); for (i = 0; i < nweights; i++) diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index 18900e0f1e..907b5ab7b0 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -4754,7 +4754,7 @@ text_to_array_internal(PG_FUNCTION_ARGS) /* XXX: this hardcodes assumptions about the text type */ PG_RETURN_ARRAYTYPE_P(construct_md_array(elems, nulls, 1, dims, lbs, - TEXTOID, -1, false, 'i')); + TEXTOID, -1, false, TYPALIGN_INT)); } text_position_setup(inputstring, fldsep, PG_GET_COLLATION(), &state); diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c index 3808c307f6..c7ae1eded8 100644 --- a/src/backend/utils/adt/xml.c +++ b/src/backend/utils/adt/xml.c @@ -4036,7 +4036,7 @@ xpath_internal(text *xpath_expr_text, xmltype *data, ArrayType *namespaces, Assert(ARR_ELEMTYPE(namespaces) == TEXTOID); - deconstruct_array(namespaces, TEXTOID, -1, false, 'i', + deconstruct_array(namespaces, TEXTOID, -1, false, TYPALIGN_INT, &ns_names_uris, &ns_names_uris_nulls, &ns_count); |