postgresql/src/backend
Peter Eisentraut a359d37019 Simplify and generalize PrepareSortSupportFromIndexRel()
PrepareSortSupportFromIndexRel() was accepting btree strategy numbers
purely for the purpose of comparing it later against btree strategies
to determine if the sort direction was forward or reverse.  Change
that.  Instead, pass a bool directly, to indicate the same without an
unfortunate assumption that a strategy number refers specifically to a
btree strategy.  (This is similar in spirit to commits 0d2aa4d493 and
c594f1ad2ba.)

(This could arguably be simplfied further by having the callers fill
in ssup_reverse directly.  But this way, it preserves consistency by
having all PrepareSortSupport*() variants be responsible for filling
in ssup_reverse.)

Moreover, remove the hardcoded check against BTREE_AM_OID, and check
against amcanorder instead, which is the actual requirement.

Co-authored-by: Mark Dilger <mark.dilger@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/flat/E72EAA49-354D-4C2E-8EB9-255197F55330@enterprisedb.com
2025-03-14 10:34:08 +01:00
..
access Simplify and generalize PrepareSortSupportFromIndexRel() 2025-03-14 10:34:08 +01:00
archive Update copyright for 2025 2025-01-01 11:21:55 -05:00
backup pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
bootstrap Remove unnecessary (char *) casts [mem] 2025-02-12 08:50:13 +01:00
catalog CREATE INDEX: do update index stats if autovacuum=off. 2025-03-10 17:49:27 -04:00
commands Remove direct handling of reloptions for toast tables 2025-03-14 09:28:51 +01:00
executor Handle interrupts while waiting on Append's async subplans 2025-03-12 20:53:09 +02:00
foreign Update copyright for 2025 2025-01-01 11:21:55 -05:00
jit Add special case fast-paths for strict functions 2025-03-11 12:02:42 +01:00
lib Update copyright for 2025 2025-01-01 11:21:55 -05:00
libpq Modularize log_connections output 2025-03-12 11:35:21 -04:00
main Update copyright for 2025 2025-01-01 11:21:55 -05:00
nodes Build whole-row Vars the same way during parsing and planning. 2025-03-12 11:47:38 -04:00
optimizer Fix incorrect handling of subquery pullup 2025-03-13 16:36:03 +09:00
parser Fix ARRAY_SUBLINK and ARRAY[] for int2vector and oidvector input. 2025-03-13 16:07:55 -04:00
partitioning Fix bug in cbc127917 to handle nested Append correctly 2025-02-25 09:24:42 +09:00
po Update copyright for 2025 2025-01-01 11:21:55 -05:00
port Update copyright for 2025 2025-01-01 11:21:55 -05:00
postmaster pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
regex Support PG_UNICODE_FAST locale in the builtin collation provider. 2025-01-17 15:56:30 -08:00
replication Fix ALTER SUBSCRIPTION ... SET PUBLICATION ... command. 2025-03-14 08:57:40 +05:30
rewrite Fix incorrect handling of subquery pullup 2025-03-13 16:36:03 +09:00
snowball Update to latest Snowball sources. 2025-02-18 21:13:54 -05:00
statistics Address stats import review comments. 2025-03-05 23:07:25 -08:00
storage Respect changing pin limits in read_stream.c. 2025-03-14 21:21:09 +13:00
tcop Add connection establishment duration logging 2025-03-12 11:35:27 -04:00
tsearch Clear errno before calling strtol() in spell.c. 2025-03-08 11:24:25 -05:00
utils Simplify and generalize PrepareSortSupportFromIndexRel() 2025-03-14 10:34:08 +01:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile Update copyright for 2025 2025-01-01 11:21:55 -05:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls.mk Return yyparse() result not via global variable 2025-01-24 06:55:39 +01:00