Skip to content

Commit 82a532b

Browse files
committed
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
1 parent eb68379 commit 82a532b

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

src/include/catalog/pg_description.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ CATALOG(pg_description,2609) BKI_WITHOUT_OIDS
5252
int32 objsubid; /* column number, or 0 if not used */
5353

5454
#ifdef CATALOG_VARLEN /* variable-length fields start here */
55-
text description; /* description of object */
55+
text description BKI_FORCE_NOT_NULL; /* description of object */
5656
#endif
5757
} FormData_pg_description;
5858

src/include/catalog/pg_extension.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ CATALOG(pg_extension,3079)
3636
bool extrelocatable; /* if true, allow ALTER EXTENSION SET SCHEMA */
3737

3838
#ifdef CATALOG_VARLEN /* variable-length fields start here */
39-
/* extversion should never be null, but the others can be. */
40-
text extversion; /* extension version name */
39+
/* extversion may never be null, but the others can be. */
40+
text extversion BKI_FORCE_NOT_NULL; /* extension version name */
4141
Oid extconfig[1]; /* dumpable configuration tables */
4242
text extcondition[1]; /* WHERE clauses for config tables */
4343
#endif

src/include/catalog/pg_largeobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ CATALOG(pg_largeobject,2613) BKI_WITHOUT_OIDS
3434
int32 pageno; /* Page number (starting from 0) */
3535

3636
/* data has variable length, but we allow direct access; see inv_api.c */
37-
bytea data; /* Data for page (may be zero-length) */
37+
bytea data BKI_FORCE_NOT_NULL; /* Data for page (may be zero-length) */
3838
} FormData_pg_largeobject;
3939

4040
/* ----------------

src/include/catalog/pg_pltemplate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ CATALOG(pg_pltemplate,1136) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
3535
bool tmpldbacreate; /* PL is installable by db owner? */
3636

3737
#ifdef CATALOG_VARLEN /* variable-length fields start here */
38-
text tmplhandler; /* name of call handler function */
38+
text tmplhandler BKI_FORCE_NOT_NULL; /* name of call handler function */
3939
text tmplinline; /* name of anonymous-block handler, or NULL */
4040
text tmplvalidator; /* name of validator function, or NULL */
41-
text tmpllibrary; /* path of shared library */
41+
text tmpllibrary BKI_FORCE_NOT_NULL; /* path of shared library */
4242
aclitem tmplacl[1]; /* access privileges for template */
4343
#endif
4444
} FormData_pg_pltemplate;

src/include/catalog/pg_proc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ CATALOG(pg_proc,1255) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81) BKI_SCHEMA_MACRO
6666
text proargnames[1]; /* parameter names (NULL if no names) */
6767
pg_node_tree proargdefaults;/* list of expression trees for argument
6868
* defaults (NULL if none) */
69-
text prosrc; /* procedure source text */
69+
text prosrc BKI_FORCE_NOT_NULL; /* procedure source text */
7070
text probin; /* secondary procedure info (can be NULL) */
7171
text proconfig[1]; /* procedure-local GUC settings */
7272
aclitem proacl[1]; /* access permissions */

src/include/catalog/pg_seclabel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ CATALOG(pg_seclabel,3596) BKI_WITHOUT_OIDS
2727
int32 objsubid; /* column number, or 0 if not used */
2828

2929
#ifdef CATALOG_VARLEN /* variable-length fields start here */
30-
text provider; /* name of label provider */
31-
text label; /* security label of the object */
30+
text provider BKI_FORCE_NOT_NULL; /* name of label provider */
31+
text label BKI_FORCE_NOT_NULL; /* security label of the object */
3232
#endif
3333
} FormData_pg_seclabel;
3434

src/include/catalog/pg_shdescription.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ CATALOG(pg_shdescription,2396) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
4444
Oid classoid; /* OID of table containing object */
4545

4646
#ifdef CATALOG_VARLEN /* variable-length fields start here */
47-
text description; /* description of object */
47+
text description BKI_FORCE_NOT_NULL; /* description of object */
4848
#endif
4949
} FormData_pg_shdescription;
5050

src/include/catalog/pg_shseclabel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ CATALOG(pg_shseclabel,3592) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
2626
Oid classoid; /* OID of table containing the shared object */
2727

2828
#ifdef CATALOG_VARLEN /* variable-length fields start here */
29-
text provider; /* name of label provider */
30-
text label; /* security label of the object */
29+
text provider BKI_FORCE_NOT_NULL; /* name of label provider */
30+
text label BKI_FORCE_NOT_NULL; /* security label of the object */
3131
#endif
3232
} FormData_pg_shseclabel;
3333

src/include/catalog/pg_trigger.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ CATALOG(pg_trigger,2620)
5757
int2vector tgattr; /* column numbers, if trigger is on columns */
5858

5959
#ifdef CATALOG_VARLEN
60-
bytea tgargs; /* first\000second\000tgnargs\000 */
60+
bytea tgargs BKI_FORCE_NOT_NULL; /* first\000second\000tgnargs\000 */
6161
pg_node_tree tgqual; /* WHEN expression, or NULL if none */
6262
#endif
6363
} FormData_pg_trigger;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy