From 2c1c802be10ac574abf33d6293c8db7309d6b157 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 12 Jul 2023 16:12:35 +0200 Subject: [PATCH v2 05/10] Improve some catalog documentation Point out that typstorage and attstorage are never '\0', even for fixed-length types. This is different from attcompression. For this reason, some of the handling of these columns in tablecmds.c etc. is different. (catalogs.sgml already contained this information in an indirect way.) --- src/include/catalog/pg_attribute.h | 10 +++++----- src/include/catalog/pg_type.h | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/include/catalog/pg_attribute.h b/src/include/catalog/pg_attribute.h index f00df488ce..9b7442493a 100644 --- a/src/include/catalog/pg_attribute.h +++ b/src/include/catalog/pg_attribute.h @@ -108,11 +108,11 @@ CATALOG(pg_attribute,1249,AttributeRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(75, */ char attalign; - /*---------- - * attstorage tells for VARLENA attributes, what the heap access - * methods can do to it if a given tuple doesn't fit into a page. - * Possible values are as for pg_type.typstorage (see TYPSTORAGE macros). - *---------- + /* + * attstorage tells for VARLENA attributes, what the heap access methods + * can do to it if a given tuple doesn't fit into a page. Possible values + * are as for pg_type.typstorage (see TYPSTORAGE macros). This is never + * '\0', even for fixed-length types. */ char attstorage; diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h index 519e570c8c..e0a86354ff 100644 --- a/src/include/catalog/pg_type.h +++ b/src/include/catalog/pg_type.h @@ -187,6 +187,9 @@ CATALOG(pg_type,1247,TypeRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(71,TypeRelati * * Note that 'm' fields can also be moved out to secondary storage, * but only as a last resort ('e' and 'x' fields are moved first). + * + * For types that are not variable-length (that is, typlen != -1), this + * must be set to 'p'. * ---------------- */ char typstorage BKI_DEFAULT(p) BKI_ARRAY_DEFAULT(x); -- 2.41.0