diff options
| author | Andres Freund | 2015-02-21 21:25:49 +0000 |
|---|---|---|
| committer | Andres Freund | 2015-02-21 21:31:54 +0000 |
| commit | eb68379c38202180bc8e33fb9987284e314b7fc8 (patch) | |
| tree | 0e6dcc59b1fabfe9c63b0d0377607acee7dad025 /src/include | |
| parent | 0627eff3602c0ce0e8358d48ddb3ffa73963e4d0 (diff) | |
Allow forcing nullness of columns during bootstrap.
Bootstrap determines whether a column is null based on simple builtin
rules. Those work surprisingly well, but nonetheless a few existing
columns aren't set correctly. Additionally there is at least one patch
sent to hackers where forcing the nullness of a column would be helpful.
The boostrap format has gained FORCE [NOT] NULL for this, which will be
emitted by genbki.pl when BKI_FORCE_(NOT_)?NULL is specified for a
column in a catalog header.
This patch doesn't change the marking of any existing columns.
Discussion: 20150215170014.GE15326@awork2.anarazel.de
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/bootstrap/bootstrap.h | 6 | ||||
| -rw-r--r-- | src/include/catalog/genbki.h | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/include/bootstrap/bootstrap.h b/src/include/bootstrap/bootstrap.h index be4430adffd..f9cbc137e72 100644 --- a/src/include/bootstrap/bootstrap.h +++ b/src/include/bootstrap/bootstrap.h @@ -23,6 +23,10 @@ */ #define MAXATTR 40 +#define BOOTCOL_NULL_AUTO 1 +#define BOOTCOL_NULL_FORCE_NULL 2 +#define BOOTCOL_NULL_FORCE_NOT_NULL 3 + extern Relation boot_reldesc; extern Form_pg_attribute attrtypes[MAXATTR]; extern int numattr; @@ -35,7 +39,7 @@ extern void err_out(void); extern void closerel(char *name); extern void boot_openrel(char *name); -extern void DefineAttr(char *name, char *type, int attnum); +extern void DefineAttr(char *name, char *type, int attnum, int nullness); extern void InsertOneTuple(Oid objectid); extern void InsertOneValue(char *value, int i); extern void InsertOneNull(int i); diff --git a/src/include/catalog/genbki.h b/src/include/catalog/genbki.h index 5d6039db835..cebf51d509d 100644 --- a/src/include/catalog/genbki.h +++ b/src/include/catalog/genbki.h @@ -28,6 +28,8 @@ #define BKI_WITHOUT_OIDS #define BKI_ROWTYPE_OID(oid) #define BKI_SCHEMA_MACRO +#define BKI_FORCE_NULL +#define BKI_FORCE_NOT_NULL /* * This is never defined; it's here only for documentation. |
