elsif ($declaring_attributes)
{
next if (/^{|^$/);
+ next if (/^#/);
if (/^}/)
{
undef $declaring_attributes;
else
{
my ($atttype, $attname) = split /\s+/, $_;
+ die "parse error ($input_file)" unless $attname;
if (exists $RENAME_ATTTYPE{$atttype})
{
$atttype = $RENAME_ATTTYPE{$atttype};
/* 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
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;
/* ----------------
{
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;
/* ----------------
/* 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];
/* Column-level FDW options */
text attfdwoptions[1];
+#endif
} FormData_pg_attribute;
/*
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 */
/* 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)
* If a check constraint, source-text representation of expression
*/
text consrc;
+#endif
} FormData_pg_constraint;
/* ----------------
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;
/* ----------------
{
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;
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;
/* ----------------
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;
/* ----------------
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;
/* ----------------
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;
/* ----------------
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;
/* ----------------
{
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;
/* ----------------
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) */
* each zero entry in indkey[] */
pg_node_tree indpred; /* expression tree for predicate, if a partial
* index; else NULL */
+#endif
} FormData_pg_index;
/* ----------------
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;
/* ----------------
{
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;
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;
/* ----------------
{
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;
/* ----------------
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;
/* ----------------
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) */
text probin; /* secondary procedure info (can be NULL) */
text proconfig[1]; /* procedure-local GUC settings */
aclitem proacl[1]; /* access permissions */
+#endif
} FormData_pg_proc;
/* ----------------
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;
/* ----------------
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;
/* ----------------
{
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;
/* ----------------
{
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;
/* ----------------
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
anyarray stavalues2;
anyarray stavalues3;
anyarray stavalues4;
+#endif
} FormData_pg_statistic;
#define STATISTIC_NUM_SLOTS 4
{
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;
/* ----------------
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;
/* ----------------
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;
*/
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
* 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;
/* ----------------
* 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;
/* ----------------