Commit 82a532b3 authored by Andres Freund's avatar Andres Freund

Force some system catalog table columns to be marked NOT NULL.

In a manual pass over the catalog declaration I found a number of
columns which the boostrap automatism didn't mark NOT NULL even though
they actually were. Add BKI_FORCE_NOT_NULL markings to them.

It's usually not critical if a system table column is falsely determined
to be nullable as the code should always catch relevant cases. But it's
good to have a extra layer in place.

Discussion: 20150215170014.GE15326@awork2.anarazel.de
parent eb68379c
...@@ -52,7 +52,7 @@ CATALOG(pg_description,2609) BKI_WITHOUT_OIDS ...@@ -52,7 +52,7 @@ CATALOG(pg_description,2609) BKI_WITHOUT_OIDS
int32 objsubid; /* column number, or 0 if not used */ int32 objsubid; /* column number, or 0 if not used */
#ifdef CATALOG_VARLEN /* variable-length fields start here */ #ifdef CATALOG_VARLEN /* variable-length fields start here */
text description; /* description of object */ text description BKI_FORCE_NOT_NULL; /* description of object */
#endif #endif
} FormData_pg_description; } FormData_pg_description;
......
...@@ -36,8 +36,8 @@ CATALOG(pg_extension,3079) ...@@ -36,8 +36,8 @@ CATALOG(pg_extension,3079)
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 */ #ifdef CATALOG_VARLEN /* variable-length fields start here */
/* extversion should never be null, but the others can be. */ /* extversion may never be null, but the others can be. */
text extversion; /* extension version name */ text extversion BKI_FORCE_NOT_NULL; /* 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 #endif
......
...@@ -34,7 +34,7 @@ CATALOG(pg_largeobject,2613) BKI_WITHOUT_OIDS ...@@ -34,7 +34,7 @@ CATALOG(pg_largeobject,2613) BKI_WITHOUT_OIDS
int32 pageno; /* Page number (starting from 0) */ int32 pageno; /* Page number (starting from 0) */
/* data has variable length, but we allow direct access; see inv_api.c */ /* data has variable length, but we allow direct access; see inv_api.c */
bytea data; /* Data for page (may be zero-length) */ bytea data BKI_FORCE_NOT_NULL; /* Data for page (may be zero-length) */
} FormData_pg_largeobject; } FormData_pg_largeobject;
/* ---------------- /* ----------------
......
...@@ -35,10 +35,10 @@ CATALOG(pg_pltemplate,1136) BKI_SHARED_RELATION BKI_WITHOUT_OIDS ...@@ -35,10 +35,10 @@ CATALOG(pg_pltemplate,1136) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
bool tmpldbacreate; /* PL is installable by db owner? */ bool tmpldbacreate; /* PL is installable by db owner? */
#ifdef CATALOG_VARLEN /* variable-length fields start here */ #ifdef CATALOG_VARLEN /* variable-length fields start here */
text tmplhandler; /* name of call handler function */ text tmplhandler BKI_FORCE_NOT_NULL; /* 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 BKI_FORCE_NOT_NULL; /* path of shared library */
aclitem tmplacl[1]; /* access privileges for template */ aclitem tmplacl[1]; /* access privileges for template */
#endif #endif
} FormData_pg_pltemplate; } FormData_pg_pltemplate;
......
...@@ -66,7 +66,7 @@ CATALOG(pg_proc,1255) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81) BKI_SCHEMA_MACRO ...@@ -66,7 +66,7 @@ CATALOG(pg_proc,1255) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81) BKI_SCHEMA_MACRO
text proargnames[1]; /* parameter names (NULL if no names) */ text proargnames[1]; /* parameter names (NULL if no names) */
pg_node_tree proargdefaults;/* list of expression trees for argument pg_node_tree proargdefaults;/* list of expression trees for argument
* defaults (NULL if none) */ * defaults (NULL if none) */
text prosrc; /* procedure source text */ text prosrc BKI_FORCE_NOT_NULL; /* procedure source text */
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 */
......
...@@ -27,8 +27,8 @@ CATALOG(pg_seclabel,3596) BKI_WITHOUT_OIDS ...@@ -27,8 +27,8 @@ CATALOG(pg_seclabel,3596) BKI_WITHOUT_OIDS
int32 objsubid; /* column number, or 0 if not used */ int32 objsubid; /* column number, or 0 if not used */
#ifdef CATALOG_VARLEN /* variable-length fields start here */ #ifdef CATALOG_VARLEN /* variable-length fields start here */
text provider; /* name of label provider */ text provider BKI_FORCE_NOT_NULL; /* name of label provider */
text label; /* security label of the object */ text label BKI_FORCE_NOT_NULL; /* security label of the object */
#endif #endif
} FormData_pg_seclabel; } FormData_pg_seclabel;
......
...@@ -44,7 +44,7 @@ CATALOG(pg_shdescription,2396) BKI_SHARED_RELATION BKI_WITHOUT_OIDS ...@@ -44,7 +44,7 @@ CATALOG(pg_shdescription,2396) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
Oid classoid; /* OID of table containing object */ Oid classoid; /* OID of table containing object */
#ifdef CATALOG_VARLEN /* variable-length fields start here */ #ifdef CATALOG_VARLEN /* variable-length fields start here */
text description; /* description of object */ text description BKI_FORCE_NOT_NULL; /* description of object */
#endif #endif
} FormData_pg_shdescription; } FormData_pg_shdescription;
......
...@@ -26,8 +26,8 @@ CATALOG(pg_shseclabel,3592) BKI_SHARED_RELATION BKI_WITHOUT_OIDS ...@@ -26,8 +26,8 @@ CATALOG(pg_shseclabel,3592) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
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 */ #ifdef CATALOG_VARLEN /* variable-length fields start here */
text provider; /* name of label provider */ text provider BKI_FORCE_NOT_NULL; /* name of label provider */
text label; /* security label of the object */ text label BKI_FORCE_NOT_NULL; /* security label of the object */
#endif #endif
} FormData_pg_shseclabel; } FormData_pg_shseclabel;
......
...@@ -57,7 +57,7 @@ CATALOG(pg_trigger,2620) ...@@ -57,7 +57,7 @@ CATALOG(pg_trigger,2620)
int2vector tgattr; /* column numbers, if trigger is on columns */ int2vector tgattr; /* column numbers, if trigger is on columns */
#ifdef CATALOG_VARLEN #ifdef CATALOG_VARLEN
bytea tgargs; /* first\000second\000tgnargs\000 */ bytea tgargs BKI_FORCE_NOT_NULL; /* 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 #endif
} FormData_pg_trigger; } FormData_pg_trigger;
......
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