aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/jsonpath.h
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2024-01-03 21:56:41 +0100
committerPeter Eisentraut <peter@eisentraut.org>2024-01-03 21:56:41 +0100
commit59fd390d5e8a7e169ff8f095882e32e189f3c5bd (patch)
tree69ef820292d459b35d5292058ba9ae3e4b78975a /src/include/utils/jsonpath.h
parent0958f8f6bf60639a1d22d78d5b49a6092b11833d (diff)
downloadpostgresql-59fd390d5e8a7e169ff8f095882e32e189f3c5bd.tar.gz
postgresql-59fd390d5e8a7e169ff8f095882e32e189f3c5bd.zip
Second attempt at organizing jsonpath operators and methods
Second attempt at 283a95da923. Since we can't reorder the enum values of JsonPathItemType, instead reorder the switch cases where they are used to generally follow the order of the enum values, for better maintainability.
Diffstat (limited to 'src/include/utils/jsonpath.h')
-rw-r--r--src/include/utils/jsonpath.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/utils/jsonpath.h b/src/include/utils/jsonpath.h
index f0181e045f7..0a3a6330170 100644
--- a/src/include/utils/jsonpath.h
+++ b/src/include/utils/jsonpath.h
@@ -49,6 +49,13 @@ DatumGetJsonPathPCopy(Datum d)
/*
* All node's type of jsonpath expression
+ *
+ * These become part of the on-disk representation of the jsonpath type.
+ * Therefore, to preserve pg_upgradability, the order must not be changed, and
+ * new values must be added at the end.
+ *
+ * It is recommended that switch cases etc. in other parts of the code also
+ * use this order, to maintain some consistency.
*/
typedef enum JsonPathItemType
{