From 255e6a3e40ef8ad0194f5b2c233e4a60bea4de1d Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 27 Jun 2023 09:55:56 +0200 Subject: [PATCH 08/17] 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 f8b4861b94..a821bb1665 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