On Tue, May 18, 2021 at 10:24:36AM +0900, Michael Paquier wrote: > If you switch attcompression, I'd say to go for the others while on > it. It would not be the first time in history there is a catalog > version bump between betas.
This is still an open item. FWIW, I can get behind the reordering proposed by Tom for the consistency gained with pg_type, leading to the attached to reduce the size of FormData_pg_attribute from 116b to 112b. -- Michael
diff --git a/src/include/catalog/pg_attribute.h b/src/include/catalog/pg_attribute.h index 560f8f00bb..b47e5fa2e7 100644 --- a/src/include/catalog/pg_attribute.h +++ b/src/include/catalog/pg_attribute.h @@ -111,6 +111,12 @@ CATALOG(pg_attribute,1249,AttributeRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(75, */ bool attbyval; + /* + * attalign is a copy of the typalign field from pg_type for this + * attribute. See atttypid comments above. + */ + 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. @@ -120,10 +126,10 @@ CATALOG(pg_attribute,1249,AttributeRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(75, char attstorage; /* - * attalign is a copy of the typalign field from pg_type for this - * attribute. See atttypid comments above. + * compression method. Must be InvalidCompressionMethod if and only if + * typstorage is 'plain' or 'external'. */ - char attalign; + char attcompression BKI_DEFAULT('\0'); /* This flag represents the "NOT NULL" constraint */ bool attnotnull; @@ -160,12 +166,6 @@ CATALOG(pg_attribute,1249,AttributeRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(75, /* attribute's collation, if any */ Oid attcollation BKI_LOOKUP_OPT(pg_collation); - /* - * compression method. Must be InvalidCompressionMethod if and only if - * typstorage is 'plain' or 'external'. - */ - char attcompression BKI_DEFAULT('\0'); - #ifdef CATALOG_VARLEN /* variable-length fields start here */ /* NOTE: The following fields are not present in tuple descriptors. */ @@ -193,7 +193,7 @@ CATALOG(pg_attribute,1249,AttributeRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(75, * can access fields beyond attcollation except in a real tuple! */ #define ATTRIBUTE_FIXED_PART_SIZE \ - (offsetof(FormData_pg_attribute,attcompression) + sizeof(char)) + (offsetof(FormData_pg_attribute,attcollation) + sizeof(Oid)) /* ---------------- * Form_pg_attribute corresponds to a pointer to a tuple with
signature.asc
Description: PGP signature