]> granicus.if.org Git - postgresql/commitdiff
Hide most variable-length fields from Form_pg_* structs
authorPeter Eisentraut <peter_e@gmx.net>
Fri, 27 Jan 2012 18:16:17 +0000 (20:16 +0200)
committerPeter Eisentraut <peter_e@gmx.net>
Fri, 27 Jan 2012 18:16:17 +0000 (20:16 +0200)
Those fields only appear in the structs so that genbki.pl can create
the BKI bootstrap files for the catalogs.  But they are not actually
usable from C.  So hiding them can prevent coding mistakes, saves
stack space, and can help the compiler.

In certain catalogs, the first variable-length field has been kept
visible after manual inspection.  These exceptions are noted in C
comments.

reviewed by Tom Lane

32 files changed:
src/backend/catalog/Catalog.pm
src/include/catalog/genbki.h
src/include/catalog/pg_aggregate.h
src/include/catalog/pg_attrdef.h
src/include/catalog/pg_attribute.h
src/include/catalog/pg_class.h
src/include/catalog/pg_constraint.h
src/include/catalog/pg_database.h
src/include/catalog/pg_db_role_setting.h
src/include/catalog/pg_default_acl.h
src/include/catalog/pg_description.h
src/include/catalog/pg_extension.h
src/include/catalog/pg_foreign_data_wrapper.h
src/include/catalog/pg_foreign_server.h
src/include/catalog/pg_foreign_table.h
src/include/catalog/pg_index.h
src/include/catalog/pg_language.h
src/include/catalog/pg_largeobject.h
src/include/catalog/pg_largeobject_metadata.h
src/include/catalog/pg_namespace.h
src/include/catalog/pg_pltemplate.h
src/include/catalog/pg_proc.h
src/include/catalog/pg_rewrite.h
src/include/catalog/pg_seclabel.h
src/include/catalog/pg_shdescription.h
src/include/catalog/pg_shseclabel.h
src/include/catalog/pg_statistic.h
src/include/catalog/pg_tablespace.h
src/include/catalog/pg_trigger.h
src/include/catalog/pg_ts_dict.h
src/include/catalog/pg_type.h
src/include/catalog/pg_user_mapping.h

index 1ba935cdf75319e5b3d0e22eef9054f91e1bf45e..cdb0bee1305b269bbc01b274889bf0fc95cf9789 100644 (file)
@@ -143,6 +143,7 @@ sub Catalogs
             elsif ($declaring_attributes)
             {
                 next if (/^{|^$/);
+                next if (/^#/);
                 if (/^}/)
                 {
                     undef $declaring_attributes;
@@ -150,6 +151,7 @@ sub Catalogs
                 else
                 {
                     my ($atttype, $attname) = split /\s+/, $_;
+                    die "parse error ($input_file)" unless $attname;
                     if (exists $RENAME_ATTTYPE{$atttype})
                     {
                         $atttype = $RENAME_ATTTYPE{$atttype};
index 5fe3a5bdc4249e9f864815367405d6e70eeb368f..bcf31e6c6bdb5a3c448d79de5ffda5b07bfb16c3 100644 (file)
 /* Introduces a catalog's structure definition */
 #define CATALOG(name,oid)      typedef struct CppConcat(FormData_,name)
 
+/*
+ * This is never defined; it's here only for documentation.
+ *
+ * Variable-length catalog fields (except possibly the first not nullable one)
+ * should not be visible in C structures, so they are made invisible by #ifdefs
+ * of an undefined symbol.  See also MARKNOTNULL in bootstrap.c for how this is
+ * handled.
+ */
+#undef CATALOG_VARLEN
+
 /* Options that may appear after CATALOG (on the same line) */
 #define BKI_BOOTSTRAP
 #define BKI_SHARED_RELATION
index 4e100217655e929f9c8c9ae5832bbe25c7a9f610..0c8a20c0056a37a5440a776f22a6e721f7f6912d 100644 (file)
@@ -44,7 +44,9 @@ CATALOG(pg_aggregate,2600) BKI_WITHOUT_OIDS
        regproc         aggfinalfn;
        Oid                     aggsortop;
        Oid                     aggtranstype;
-       text            agginitval;             /* VARIABLE LENGTH FIELD */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
+       text            agginitval;
+#endif
 } FormData_pg_aggregate;
 
 /* ----------------
index 01f663c09db9f21cbb201174c5ea5ccdf0966a7e..ad770e410fa17a8fdc61b333502dc3d43929ad96 100644 (file)
@@ -32,8 +32,10 @@ CATALOG(pg_attrdef,2604)
 {
        Oid                     adrelid;                /* OID of table containing attribute */
        int2            adnum;                  /* attnum of attribute */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        pg_node_tree adbin;                     /* nodeToString representation of default */
        text            adsrc;                  /* human-readable representation of default */
+#endif
 } FormData_pg_attrdef;
 
 /* ----------------
index 5cb16f6c41f9c5a020b3ec9d9d8d83280a8efe4b..45e38e4dfc0c26407efe879e4a17c6c920230a0a 100644 (file)
@@ -145,11 +145,8 @@ CATALOG(pg_attribute,1249) BKI_BOOTSTRAP BKI_WITHOUT_OIDS BKI_ROWTYPE_OID(75) BK
        /* attribute's collation */
        Oid                     attcollation;
 
-       /*
-        * VARIABLE LENGTH FIELDS start here.  These fields may be NULL, too.
-        *
-        * NOTE: the following fields are not present in tuple descriptors!
-        */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
+       /* NOTE: The following fields are not present in tuple descriptors. */
 
        /* Column-level access permissions */
        aclitem         attacl[1];
@@ -159,6 +156,7 @@ CATALOG(pg_attribute,1249) BKI_BOOTSTRAP BKI_WITHOUT_OIDS BKI_ROWTYPE_OID(75) BK
 
        /* Column-level FDW options */
        text            attfdwoptions[1];
+#endif
 } FormData_pg_attribute;
 
 /*
index 829f9b9c1d6412625a4ab773eeae9008944975e5..3b01bb4365456856a7f67c2ef4baf0ad8eade89f 100644 (file)
@@ -68,14 +68,11 @@ CATALOG(pg_class,1259) BKI_BOOTSTRAP BKI_ROWTYPE_OID(83) BKI_SCHEMA_MACRO
        bool            relhassubclass; /* has (or has had) derived classes */
        TransactionId relfrozenxid; /* all Xids < this are frozen in this rel */
 
-       /*
-        * VARIABLE LENGTH FIELDS start here.  These fields may be NULL, too.
-        *
-        * NOTE: these fields are not present in a relcache entry's rd_rel field.
-        */
-
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
+       /* NOTE: These fields are not present in a relcache entry's rd_rel field. */
        aclitem         relacl[1];              /* access permissions */
        text            reloptions[1];  /* access-method-specific options */
+#endif
 } FormData_pg_class;
 
 /* Size of fixed part of pg_class tuples, not counting var-length fields */
index c9628348a1fe903fc1c9df6b8510aebfe8de8cad..77015ae2f36e81a5327b2861b6a3638cba9a9d77 100644 (file)
@@ -91,10 +91,7 @@ CATALOG(pg_constraint,2606)
        /* Has a local definition and cannot be inherited */
        bool            conisonly;
 
-       /*
-        * VARIABLE LENGTH FIELDS start here.  These fields may be NULL, too.
-        */
-
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        /*
         * Columns of conrelid that the constraint applies to, if known (this is
         * NULL for trigger constraints)
@@ -139,6 +136,7 @@ CATALOG(pg_constraint,2606)
         * If a check constraint, source-text representation of expression
         */
        text            consrc;
+#endif
 } FormData_pg_constraint;
 
 /* ----------------
index 57537c81f22c171a5f62973a779b3c22d62658c1..e8509f59bbbfd13cd4e1c045838d4086e7a14279 100644 (file)
@@ -42,7 +42,9 @@ CATALOG(pg_database,1262) BKI_SHARED_RELATION BKI_ROWTYPE_OID(1248) BKI_SCHEMA_M
        Oid                     datlastsysoid;  /* highest OID to consider a system OID */
        TransactionId datfrozenxid; /* all Xids < this are frozen in this DB */
        Oid                     dattablespace;  /* default table space for this DB */
-       aclitem         datacl[1];              /* access permissions (VAR LENGTH) */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
+       aclitem         datacl[1];              /* access permissions */
+#endif
 } FormData_pg_database;
 
 /* ----------------
index 192404316a4b5036725f951c54d75b2c18308c88..c6e2f3b4dca5cd60dd50fb3489b90179dbf72f79 100644 (file)
@@ -35,7 +35,9 @@ CATALOG(pg_db_role_setting,2964) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
 {
        Oid                     setdatabase;    /* database */
        Oid                     setrole;                /* role */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        text            setconfig[1];   /* GUC settings to apply at login */
+#endif
 } FormData_pg_db_role_setting;
 
 typedef FormData_pg_db_role_setting *Form_pg_db_role_setting;
index 9fd207d950ee531d16dc859b74bc27aaa04c6b2c..f36ce52519b74074939db20e3dd61ed1b1b59120 100644 (file)
@@ -32,12 +32,9 @@ CATALOG(pg_default_acl,826)
        Oid                     defaclrole;             /* OID of role owning this ACL */
        Oid                     defaclnamespace;        /* OID of namespace, or 0 for all */
        char            defaclobjtype;  /* see DEFACLOBJ_xxx constants below */
-
-       /*
-        * VARIABLE LENGTH FIELDS start here.
-        */
-
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        aclitem         defaclacl[1];   /* permissions to add at CREATE time */
+#endif
 } FormData_pg_default_acl;
 
 /* ----------------
index 0e06500763205ae9890c2f997ff557589abab070..352c51736982125d382c60c5b10052aad72abfe0 100644 (file)
@@ -50,7 +50,9 @@ CATALOG(pg_description,2609) BKI_WITHOUT_OIDS
        Oid                     objoid;                 /* OID of object itself */
        Oid                     classoid;               /* OID of table containing object */
        int4            objsubid;               /* column number, or 0 if not used */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        text            description;    /* description of object */
+#endif
 } FormData_pg_description;
 
 /* ----------------
index 606ed9a2af7e0ee3db1569e9fca9853311ba5065..b07b43cf7e65ae484a541e1a4797ea08f786297b 100644 (file)
@@ -34,15 +34,12 @@ CATALOG(pg_extension,3079)
        Oid                     extowner;               /* extension owner */
        Oid                     extnamespace;   /* namespace of contained objects */
        bool            extrelocatable; /* if true, allow ALTER EXTENSION SET SCHEMA */
-
-       /*
-        * VARIABLE LENGTH FIELDS start here.
-        *
-        * extversion should never be null, but the others can be.
-        */
+#ifdef CATALOG_VARLEN                   /* variable-length fields start here */
+       /* extversion should never be null, but the others can be. */
        text            extversion;             /* extension version name */
        Oid                     extconfig[1];   /* dumpable configuration tables */
        text            extcondition[1];        /* WHERE clauses for config tables */
+#endif
 } FormData_pg_extension;
 
 /* ----------------
index 90a51a2f4b9318067517df6cd7a78b18924ac2d0..b6dd8eb7cc81fa20519abfb24843e2c0799eff12 100644 (file)
@@ -34,11 +34,10 @@ CATALOG(pg_foreign_data_wrapper,2328)
        Oid                     fdwowner;               /* FDW owner */
        Oid                     fdwhandler;             /* handler function, or 0 if none */
        Oid                     fdwvalidator;   /* option validation function, or 0 if none */
-
-       /* VARIABLE LENGTH FIELDS start here. */
-
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        aclitem         fdwacl[1];              /* access permissions */
        text            fdwoptions[1];  /* FDW options */
+#endif
 } FormData_pg_foreign_data_wrapper;
 
 /* ----------------
index a96328cd2775e94013d8ddd8f9c4dcedd44f1672..dd1e65e02aa65b62d1388f4850e32c98d7004403 100644 (file)
@@ -31,14 +31,12 @@ CATALOG(pg_foreign_server,1417)
        NameData        srvname;                /* foreign server name */
        Oid                     srvowner;               /* server owner */
        Oid                     srvfdw;                 /* server FDW */
-
-       /*
-        * VARIABLE LENGTH FIELDS start here.  These fields may be NULL, too.
-        */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        text            srvtype;
        text            srvversion;
        aclitem         srvacl[1];              /* access permissions */
        text            srvoptions[1];  /* FDW-specific options */
+#endif
 } FormData_pg_foreign_server;
 
 /* ----------------
index 71992d3c42a5a81f73e4fd821c11af0fefd3b06a..9af983eb93bb4404e77a6545d3cfc032849f15f1 100644 (file)
@@ -30,7 +30,9 @@ CATALOG(pg_foreign_table,3118) BKI_WITHOUT_OIDS
 {
        Oid                     ftrelid;                /* OID of foreign table */
        Oid                     ftserver;               /* OID of foreign server */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        text            ftoptions[1];   /* FDW-specific options */
+#endif
 } FormData_pg_foreign_table;
 
 /* ----------------
index 6c301ff17fa566fb1b764bd2762878e2da1879c8..92ca22c686ad98f80577295306342263a6115fc2 100644 (file)
@@ -42,8 +42,9 @@ CATALOG(pg_index,2610) BKI_WITHOUT_OIDS BKI_SCHEMA_MACRO
        bool            indcheckxmin;   /* must we wait for xmin to be old? */
        bool            indisready;             /* is this index ready for inserts? */
 
-       /* VARIABLE LENGTH FIELDS: */
+       /* variable-length fields start here, but we allow direct access to indkey */
        int2vector      indkey;                 /* column numbers of indexed cols, or 0 */
+#ifdef CATALOG_VARLEN
        oidvector       indcollation;   /* collation identifiers */
        oidvector       indclass;               /* opclass identifiers */
        int2vector      indoption;              /* per-column flags (AM-specific meanings) */
@@ -52,6 +53,7 @@ CATALOG(pg_index,2610) BKI_WITHOUT_OIDS BKI_SCHEMA_MACRO
                                                                 * each zero entry in indkey[] */
        pg_node_tree indpred;           /* expression tree for predicate, if a partial
                                                                 * index; else NULL */
+#endif
 } FormData_pg_index;
 
 /* ----------------
index fd8ea0b79d72d7f62a6a05cf8b130d55ce6f744b..eb4ae5ab2d32a766823f0566423fc7b361cea39a 100644 (file)
@@ -37,7 +37,9 @@ CATALOG(pg_language,2612)
        Oid                     lanplcallfoid;  /* Call handler for PL */
        Oid                     laninline;              /* Optional anonymous-block handler function */
        Oid                     lanvalidator;   /* Optional validation function */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        aclitem         lanacl[1];              /* Access privileges */
+#endif
 } FormData_pg_language;
 
 /* ----------------
index 7c53e1e10e957a50541990286768e32ec62cb968..b89d4ec1a90e0dd38fb63a334105fea394887d45 100644 (file)
@@ -32,6 +32,7 @@ CATALOG(pg_largeobject,2613) BKI_WITHOUT_OIDS
 {
        Oid                     loid;                   /* Identifier of large object */
        int4            pageno;                 /* Page number (starting from 0) */
+       /* data has variable length, but we allow direct access; see inv_api.c */
        bytea           data;                   /* Data for page (may be zero-length) */
 } FormData_pg_largeobject;
 
index dea4d1289cf907967884118218ba7f2b64eab59f..c280176491963981994c5e5a963598bf764d415d 100644 (file)
@@ -31,7 +31,9 @@
 CATALOG(pg_largeobject_metadata,2995)
 {
        Oid                     lomowner;               /* OID of the largeobject owner */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        aclitem         lomacl[1];              /* access permissions */
+#endif
 } FormData_pg_largeobject_metadata;
 
 /* ----------------
index 52a97f1a9e4113b446013451f22f2b91d57f958d..aad76a1452aae126c468553bec752182a980ff12 100644 (file)
@@ -37,7 +37,9 @@ CATALOG(pg_namespace,2615)
 {
        NameData        nspname;
        Oid                     nspowner;
-       aclitem         nspacl[1];              /* VARIABLE LENGTH FIELD */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
+       aclitem         nspacl[1];
+#endif
 } FormData_pg_namespace;
 
 /* ----------------
index ce249c0e0fe78a4c0706f724317a62a5e7ffe270..00abd533708666b5aba7cec099f3c49d07dcd795 100644 (file)
@@ -33,11 +33,13 @@ CATALOG(pg_pltemplate,1136) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
        NameData        tmplname;               /* name of PL */
        bool            tmpltrusted;    /* PL is trusted? */
        bool            tmpldbacreate;  /* PL is installable by db owner? */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        text            tmplhandler;    /* name of call handler function */
        text            tmplinline;             /* name of anonymous-block handler, or NULL */
        text            tmplvalidator;  /* name of validator function, or NULL */
        text            tmpllibrary;    /* path of shared library */
        aclitem         tmplacl[1];             /* access privileges for template */
+#endif
 } FormData_pg_pltemplate;
 
 /* ----------------
index ba4f5b6034513d58c9c6159e0ee8e3ccb0408c8e..5e880d2a4d5e526f1bfa0a77401cb173188a4c81 100644 (file)
@@ -53,8 +53,9 @@ CATALOG(pg_proc,1255) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81) BKI_SCHEMA_MACRO
        int2            pronargdefaults;        /* number of arguments with defaults */
        Oid                     prorettype;             /* OID of result type */
 
-       /* VARIABLE LENGTH FIELDS: */
+       /* variable-length fields start here, but we allow direct access to proargtypes */
        oidvector       proargtypes;    /* parameter types (excludes OUT params) */
+#ifdef CATALOG_VARLEN
        Oid                     proallargtypes[1];              /* all param types (NULL if IN only) */
        char            proargmodes[1]; /* parameter modes (NULL if IN only) */
        text            proargnames[1]; /* parameter names (NULL if no names) */
@@ -64,6 +65,7 @@ CATALOG(pg_proc,1255) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81) BKI_SCHEMA_MACRO
        text            probin;                 /* secondary procedure info (can be NULL) */
        text            proconfig[1];   /* procedure-local GUC settings */
        aclitem         proacl[1];              /* access permissions */
+#endif
 } FormData_pg_proc;
 
 /* ----------------
index eb16b2dc2dd622860e7c074e8b8b30eb7f14a4be..e04ba81b3c2cccd931d74ca505db05a878043cd5 100644 (file)
@@ -39,10 +39,10 @@ CATALOG(pg_rewrite,2618)
        char            ev_type;
        char            ev_enabled;
        bool            is_instead;
-
-       /* NB: remaining fields must be accessed via heap_getattr */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        pg_node_tree ev_qual;
        pg_node_tree ev_action;
+#endif
 } FormData_pg_rewrite;
 
 /* ----------------
index b468d6924b4843fec3fe3210c8754c44cd04f6bd..101ec3c111b45f8899ef36d23a38007d2d6b8a93 100644 (file)
@@ -25,8 +25,10 @@ CATALOG(pg_seclabel,3596) BKI_WITHOUT_OIDS
        Oid                     objoid;                 /* OID of the object itself */
        Oid                     classoid;               /* OID of table containing the object */
        int4            objsubid;               /* column number, or 0 if not used */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        text            provider;               /* name of label provider */
        text            label;                  /* security label of the object */
+#endif
 } FormData_pg_seclabel;
 
 /* ----------------
index 6d0ee3bcbb8ddd227f57489ef4b0ce32e44acbfc..377f4337d9a3810ec7ee1e67ed9a81cf92221ce3 100644 (file)
@@ -42,7 +42,9 @@ CATALOG(pg_shdescription,2396) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
 {
        Oid                     objoid;                 /* OID of object itself */
        Oid                     classoid;               /* OID of table containing object */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        text            description;    /* description of object */
+#endif
 } FormData_pg_shdescription;
 
 /* ----------------
index 235564f5ddbe087f5e250f2401863aa67df45e81..d7c49e78bb5c1a38e5e03f93a5e1240e8ada20ac 100644 (file)
@@ -24,8 +24,10 @@ CATALOG(pg_shseclabel,3592) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
 {
        Oid                     objoid;         /* OID of the shared object itself */
        Oid                     classoid;       /* OID of table containing the shared object */
+#ifdef CATALOG_VARLEN          /* variable-length fields start here */
        text            provider;       /* name of label provider */
        text            label;          /* security label of the object */
+#endif
 } FormData_pg_shseclabel;
 
 /* ----------------
index 7d1d127ec68da339aeea09da9c6c1a15d0b2f8bc..0b15b001b43d233305825777a40ed261a7b63fff 100644 (file)
@@ -116,6 +116,7 @@ CATALOG(pg_statistic,2619) BKI_WITHOUT_OIDS
        float4          stanumbers3[1];
        float4          stanumbers4[1];
 
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        /*
         * Values in these arrays are values of the column's data type.  We
         * presently have to cheat quite a bit to allow polymorphic arrays of this
@@ -125,6 +126,7 @@ CATALOG(pg_statistic,2619) BKI_WITHOUT_OIDS
        anyarray        stavalues2;
        anyarray        stavalues3;
        anyarray        stavalues4;
+#endif
 } FormData_pg_statistic;
 
 #define STATISTIC_NUM_SLOTS  4
index a6a068659bdd56bd08089f1f953cac0e103c2971..0650a5fbae49a1c83241905270b8a06b0cdbb3cb 100644 (file)
@@ -32,8 +32,10 @@ CATALOG(pg_tablespace,1213) BKI_SHARED_RELATION
 {
        NameData        spcname;                /* tablespace name */
        Oid                     spcowner;               /* owner of tablespace */
-       aclitem         spcacl[1];              /* access permissions (VAR LENGTH) */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
+       aclitem         spcacl[1];              /* access permissions */
        text            spcoptions[1];  /* per-tablespace options */
+#endif
 } FormData_pg_tablespace;
 
 /* ----------------
index 1f29d21f632497d863369a098234351853300cd1..0ee5b8af8d1b83aab5b3e6e95b09a44b663f32dd 100644 (file)
@@ -50,10 +50,13 @@ CATALOG(pg_trigger,2620)
        bool            tginitdeferred; /* constraint trigger is deferred initially */
        int2            tgnargs;                /* # of extra arguments in tgargs */
 
-       /* VARIABLE LENGTH FIELDS (note: tgattr and tgargs must not be null) */
+       /* Variable-length fields start here, but we allow direct access to tgattr.
+        * Note: tgattr and tgargs must not be null. */
        int2vector      tgattr;                 /* column numbers, if trigger is on columns */
+#ifdef CATALOG_VARLEN
        bytea           tgargs;                 /* first\000second\000tgnargs\000 */
        pg_node_tree tgqual;            /* WHEN expression, or NULL if none */
+#endif
 } FormData_pg_trigger;
 
 /* ----------------
index 5036b8cfd28e8959f90154fa53754cd69246c5ed..31fcdd8896488ed6b63ff552ceb8b394fc48f3bc 100644 (file)
@@ -36,7 +36,9 @@ CATALOG(pg_ts_dict,3600)
        Oid                     dictnamespace;  /* name space */
        Oid                     dictowner;              /* owner */
        Oid                     dicttemplate;   /* dictionary's template */
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        text            dictinitoption; /* options passed to dict_init() */
+#endif
 } FormData_pg_ts_dict;
 
 typedef FormData_pg_ts_dict *Form_pg_ts_dict;
index e12efe45dbe46d7598d55b9a0ed55c842dc39c4e..d9855a79f8621f9a38a4531d2000e6b5c7aa9a56 100644 (file)
@@ -200,12 +200,13 @@ CATALOG(pg_type,1247) BKI_BOOTSTRAP BKI_ROWTYPE_OID(71) BKI_SCHEMA_MACRO
         */
        Oid                     typcollation;
 
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        /*
         * If typdefaultbin is not NULL, it is the nodeToString representation of
         * a default expression for the type.  Currently this is only used for
         * domains.
         */
-       pg_node_tree typdefaultbin; /* VARIABLE LENGTH FIELD */
+       pg_node_tree typdefaultbin;
 
        /*
         * typdefault is NULL if the type has no associated default value. If
@@ -215,12 +216,13 @@ CATALOG(pg_type,1247) BKI_BOOTSTRAP BKI_ROWTYPE_OID(71) BKI_SCHEMA_MACRO
         * external representation of the type's default value, which may be fed
         * to the type's input converter to produce a constant.
         */
-       text            typdefault;             /* VARIABLE LENGTH FIELD */
+       text            typdefault;
 
        /*
         * Access permissions
         */
-       aclitem         typacl[1];              /* VARIABLE LENGTH FIELD */
+       aclitem         typacl[1];
+#endif
 } FormData_pg_type;
 
 /* ----------------
index 551000fcfc003d03bde9339ce290853008ea3874..1d2f9b0bd00ceb4f2fecbe191fd0dae127d440bd 100644 (file)
@@ -32,11 +32,9 @@ CATALOG(pg_user_mapping,1418)
                                                                 * wanted */
        Oid                     umserver;               /* server of this mapping */
 
-       /*
-        * VARIABLE LENGTH FIELDS start here.  These fields may be NULL, too.
-        */
-
+#ifdef CATALOG_VARLEN                  /* variable-length fields start here */
        text            umoptions[1];   /* user mapping options */
+#endif
 } FormData_pg_user_mapping;
 
 /* ----------------