aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeModifyTable.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2022-10-31 13:54:23 +0900
committerMichael Paquier <michael@paquier.xyz>2022-10-31 13:54:23 +0900
commita73952b795632b2cf5acada8476e7cf75857e9be (patch)
tree2d5f471c77d233c002baeb05451c840620cc7de5 /src/backend/executor/nodeModifyTable.c
parentd9d873bac67047cfacc9f5ef96ee488f2cb0f1c3 (diff)
downloadpostgresql-a73952b795632b2cf5acada8476e7cf75857e9be.tar.gz
postgresql-a73952b795632b2cf5acada8476e7cf75857e9be.zip
Add check on initial and boot values when loading GUCs
This commit adds a function to perform a cross-check between the initial value of the C declaration associated to a GUC and its actual boot value in assert-enabled builds. The purpose of this is to prevent anybody reading these C declarations from being fooled by mismatched values before they are loaded at program startup. The following rules apply depending on the GUC type: * bool - can be false, or same as boot_val. * int - can be 0, or same as the boot_val. * real - can be 0.0, or same as the boot_val. * string - can be NULL, or strcmp'd equal to the boot_val. * enum - equal to the boot_val. This is done for the system as well custom GUCs loaded by external modules, which may require extension developers to adapt the C declaration of the variables used by these GUCs (testing this change with some of my own modules has allowed me to catch some stupid typos, FWIW). This may finish by being a bad experiment depending on the feedbcak received, but let's see how it goes. Author: Peter Smith Reviewed-by: Nathan Bossart, Tom Lane, Michael Paquier, Justin Pryzby Discussion: https://postgr.es/m/CAHut+PtHE0XSfjjRQ6D4v7+dqzCw=d+1a64ujra4EX8aoc_Z+w@mail.gmail.com
Diffstat (limited to 'src/backend/executor/nodeModifyTable.c')
0 files changed, 0 insertions, 0 deletions