]> granicus.if.org Git - postgresql/commitdiff
Mark some columns in pg_subscription as NOT NULL.
authorFujii Masao <fujii@postgresql.org>
Thu, 20 Apr 2017 14:35:30 +0000 (23:35 +0900)
committerFujii Masao <fujii@postgresql.org>
Thu, 20 Apr 2017 14:35:30 +0000 (23:35 +0900)
In pg_subscription, subconninfo, subslotname, subsynccommit and
subpublications are expected not to be NULL. Therefore this patch
adds BKI_FORCE_NOT_NULL markings to them.

This patch is basically unnecessary unless the code has a bug which
wrongly sets either of those columns to NULL. But it's good to have
this as a safeguard.

Author: Masahiko Sawada
Reviewed-by: Kyotaro Horiguchi
Reported-by: Fujii Masao
Discussion: http://postgr.es/m/CAHGQGwFDWh_Qr-q_GEMpD+qH=vYPMdVqw=ZOSY3kX_Pna9R9SA@mail.gmail.com

src/include/catalog/pg_subscription.h

index fae542b6129e2d98533d16dd77351d2131dfb912..5550f199267cafe2e98f01fc7851383c15152794 100644 (file)
@@ -41,10 +41,17 @@ CATALOG(pg_subscription,6100) BKI_SHARED_RELATION BKI_ROWTYPE_OID(6101) BKI_SCHE
                                                                 * (the worker should be running) */
 
 #ifdef CATALOG_VARLEN                  /* variable-length fields start here */
-       text            subconninfo;    /* Connection string to the publisher */
-       NameData        subslotname;    /* Slot name on publisher */
-       text            subsynccommit;  /* Synchronous commit setting for worker */
-       text            subpublications[1];     /* List of publications subscribed to */
+       /* Connection string to the publisher */
+       text            subconninfo BKI_FORCE_NOT_NULL;
+
+       /* Slot name on publisher */
+       NameData        subslotname BKI_FORCE_NOT_NULL;
+
+       /* Synchronous commit setting for worker */
+       text            subsynccommit BKI_FORCE_NOT_NULL;
+
+       /* List of publications subscribed to */
+       text            subpublications[1] BKI_FORCE_NOT_NULL;
 #endif
 } FormData_pg_subscription;