Commit 8137f2c3 authored by Peter Eisentraut's avatar Peter Eisentraut

Hide most variable-length fields from Form_pg_* structs

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