summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorPeter Eisentraut2024-10-14 13:36:02 +0000
committerPeter Eisentraut2024-10-14 13:36:02 +0000
commit0d2aa4d4937bb0500823edfc7d620f4e5fa45b9c (patch)
treeb5165a7924bd11544d649daac2052a649b7e6b3f /src/include
parente7d0cf42b1acb185edc947a8732843966ea3c160 (diff)
Track sort direction in SortGroupClause
Functions make_pathkey_from_sortop() and transformWindowDefinitions(), which receive a SortGroupClause, were determining the sort order (ascending vs. descending) by comparing that structure's operator strategy to BTLessStrategyNumber, but could just as easily have gotten it from the SortGroupClause object, if it had such a field, so add one. This reduces the number of places that hardcode the assumption that the strategy refers specifically to a btree strategy, rather than some other index AM's operators. Author: Mark Dilger <mark.dilger@enterprisedb.com> Discussion: https://www.postgresql.org/message-id/flat/E72EAA49-354D-4C2E-8EB9-255197F55330@enterprisedb.com
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/catversion.h2
-rw-r--r--src/include/nodes/parsenodes.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 38f0f9c1588..842c43c0b68 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -57,6 +57,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 202410114
+#define CATALOG_VERSION_NO 202410141
#endif
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 5b62df32733..c92cef3d16d 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -1438,6 +1438,7 @@ typedef struct SortGroupClause
Index tleSortGroupRef; /* reference into targetlist */
Oid eqop; /* the equality operator ('=' op) */
Oid sortop; /* the ordering operator ('<' op), or 0 */
+ bool reverse_sort; /* is sortop a "greater than" operator? */
bool nulls_first; /* do NULLs come before normal values? */
/* can eqop be implemented by hashing? */
bool hashable pg_node_attr(query_jumble_ignore);