1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Revert "Reorganise jsonpath operators and methods"

This reverts commit 283a95da92.

The reordering of JsonPathItemType affects the binary on-disk
compatibility of the jsonpath type, so we must not change it.  Revert
for now and consider.
This commit is contained in:
Peter Eisentraut
2024-01-03 21:02:49 +01:00
parent 76ba8a8b63
commit 0958f8f6bf
5 changed files with 124 additions and 131 deletions

View File

@ -66,6 +66,13 @@ typedef enum JsonPathItemType
jpiGreater, /* expr > expr */
jpiLessOrEqual, /* expr <= expr */
jpiGreaterOrEqual, /* expr >= expr */
jpiAdd, /* expr + expr */
jpiSub, /* expr - expr */
jpiMul, /* expr * expr */
jpiDiv, /* expr / expr */
jpiMod, /* expr % expr */
jpiPlus, /* + expr */
jpiMinus, /* - expr */
jpiAnyArray, /* [*] */
jpiAnyKey, /* .* */
jpiIndexArray, /* [subscript, ...] */
@ -76,28 +83,14 @@ typedef enum JsonPathItemType
jpiVariable, /* $variable */
jpiFilter, /* ? (predicate) */
jpiExists, /* EXISTS (expr) predicate */
/*
* For better maintainability or readability, keep the order of the below
* jsonpath Operators and Methods at the other places, like in the
* documentation, switch() cases, keywords list, etc., too.
*/
jpiAdd, /* expr + expr */
jpiPlus, /* + expr */
jpiSub, /* expr - expr */
jpiMinus, /* - expr */
jpiMul, /* expr * expr */
jpiDiv, /* expr / expr */
jpiMod, /* expr % expr */
jpiType, /* .type() item method */
jpiSize, /* .size() item method */
jpiDouble, /* .double() item method */
jpiAbs, /* .abs() item method */
jpiCeiling, /* .ceiling() item method */
jpiFloor, /* .floor() item method */
jpiCeiling, /* .ceiling() item method */
jpiDouble, /* .double() item method */
jpiDatetime, /* .datetime() item method */
jpiKeyValue, /* .keyvalue() item method */
jpiSubscript, /* array subscript: 'expr' or 'expr TO expr' */
jpiLast, /* LAST array subscript */
jpiStartsWith, /* STARTS WITH predicate */