From dafc5f3eda560a7b4339a4a686ddaa8678e5a5b3 Mon Sep 17 00:00:00 2001
From: Alexandre Felipe <o.alexandre.felipe@gmail.com>
Date: Wed, 6 May 2026 20:48:25 +0100
Subject: [PATCH-v12 3/6] SLOPE: catalog changes

Add prosupport annotations to built-in monotonic functions,
enabling the SLOPE optimization to use indexes for ORDER BY f(x).

Functions annotated with some monotonicity
- Arithmetic: int2/4/8 and float4/8 add, subtract, multiply, divide
- Unary minus: int2um, int4um, int8um, float4um, float8um
- Rounding: floor, ceil (float8 and numeric variants)
- Date/time: date_trunc (timestamp, timestamptz, interval)
- Conversion from time samp types to date.

Also adds the prosupport function entries to pg_proc.dat
- arg0_asc_slope_support (OID 9954)
- arg0_desc_slope_support (OID 9955)
- arg1_asc_slope_support (OID 9956)
- diff_slope_support (OID 9957)
- addition_slope_support (OID 9958)
- multiply_slope_support (OID 9959)
- divide_slope_support (OID 9960)

Bump catversion for catalog changes.
---
 src/backend/catalog/system_functions.sql    |  10 +
 src/backend/utils/adt/misc.c                | 358 ++++++++++++
 src/include/catalog/pg_proc.dat             | 570 +++++++++++++-------
 src/include/nodes/supportnodes.h            |  25 +
 src/test/regress/expected/slope_catalog.out | 296 ++++++++++
 src/test/regress/parallel_schedule          |   2 +-
 src/test/regress/sql/slope_catalog.sql      |  69 +++
 7 files changed, 1123 insertions(+), 207 deletions(-)
 create mode 100644 src/test/regress/expected/slope_catalog.out
 create mode 100644 src/test/regress/sql/slope_catalog.sql

diff --git a/src/backend/catalog/system_functions.sql b/src/backend/catalog/system_functions.sql
index c3c0a6e84ed..046fcf7543e 100644
--- a/src/backend/catalog/system_functions.sql
+++ b/src/backend/catalog/system_functions.sql
@@ -66,30 +66,35 @@ RETURN octet_length($1) * 8;
 CREATE OR REPLACE FUNCTION log(numeric)
  RETURNS numeric
  LANGUAGE sql
+ SUPPORT arg0_asc_slope_support
  IMMUTABLE PARALLEL SAFE STRICT COST 1
 RETURN log(10, $1);
 
 CREATE OR REPLACE FUNCTION log10(numeric)
  RETURNS numeric
  LANGUAGE sql
+ SUPPORT arg0_asc_slope_support
  IMMUTABLE PARALLEL SAFE STRICT COST 1
 RETURN log(10, $1);
 
 CREATE OR REPLACE FUNCTION round(numeric)
  RETURNS numeric
  LANGUAGE sql
+ SUPPORT arg0_asc_slope_support
  IMMUTABLE PARALLEL SAFE STRICT COST 1
 RETURN round($1, 0);
 
 CREATE OR REPLACE FUNCTION trunc(numeric)
  RETURNS numeric
  LANGUAGE sql
+ SUPPORT arg0_asc_slope_support
  IMMUTABLE PARALLEL SAFE STRICT COST 1
 RETURN trunc($1, 0);
 
 CREATE OR REPLACE FUNCTION numeric_pl_pg_lsn(numeric, pg_lsn)
  RETURNS pg_lsn
  LANGUAGE sql
+ SUPPORT addition_slope_support
  IMMUTABLE PARALLEL SAFE STRICT COST 1
 RETURN $2 + $1;
 
@@ -120,18 +125,21 @@ RETURN date_part($1, cast($2 as timestamp));
 CREATE OR REPLACE FUNCTION timestamptz(date, time)
  RETURNS timestamptz
  LANGUAGE sql
+ SUPPORT arg0_asc_slope_support
  STABLE PARALLEL SAFE STRICT COST 1
 RETURN cast(($1 + $2) as timestamptz);
 
 CREATE OR REPLACE FUNCTION timedate_pl(time, date)
  RETURNS timestamp
  LANGUAGE sql
+ SUPPORT arg1_asc_slope_support
  IMMUTABLE PARALLEL SAFE STRICT COST 1
 RETURN $2 + $1;
 
 CREATE OR REPLACE FUNCTION timetzdate_pl(timetz, date)
  RETURNS timestamptz
  LANGUAGE sql
+ SUPPORT arg1_asc_slope_support
  IMMUTABLE PARALLEL SAFE STRICT COST 1
 RETURN $2 + $1;
 
@@ -168,6 +176,7 @@ RETURN $2 + $1;
 CREATE OR REPLACE FUNCTION integer_pl_date(integer, date)
  RETURNS date
  LANGUAGE sql
+ SUPPORT addition_slope_support
  IMMUTABLE PARALLEL SAFE STRICT COST 1
 RETURN $2 + $1;
 
@@ -237,6 +246,7 @@ RETURN ($1, ($1 + $2)) overlaps ($3, $4);
 CREATE OR REPLACE FUNCTION int8pl_inet(bigint, inet)
  RETURNS inet
  LANGUAGE sql
+ SUPPORT addition_slope_support
  IMMUTABLE PARALLEL SAFE STRICT COST 1
 RETURN $2 + $1;
 
diff --git a/src/backend/utils/adt/misc.c b/src/backend/utils/adt/misc.c
index c033e68ba15..0418928b280 100644
--- a/src/backend/utils/adt/misc.c
+++ b/src/backend/utils/adt/misc.c
@@ -32,6 +32,8 @@
 #include "funcapi.h"
 #include "miscadmin.h"
 #include "nodes/miscnodes.h"
+#include "nodes/supportnodes.h"
+#include "nodes/nodeFuncs.h"
 #include "parser/parse_type.h"
 #include "parser/scansup.h"
 #include "pgstat.h"
@@ -43,12 +45,30 @@
 #include "utils/builtins.h"
 #include "utils/fmgroids.h"
 #include "utils/lsyscache.h"
+#include "utils/numeric.h"
 #include "utils/ruleutils.h"
 #include "utils/syscache.h"
 #include "utils/timestamp.h"
 #include "utils/tuplestore.h"
 #include "utils/wait_event.h"
 
+/**
+ * Extended numeric sign, the usual -1, 0, 1,
+ * for real numbers, and additional values for non-real
+ * numeric values and null.
+*/
+
+typedef enum NUMERIC_SIGN
+{
+	NUMERIC_SIGN_NINF = -2,
+	NUMERIC_SIGN_NEG = -1,
+	NUMERIC_SIGN_ZERO = 0,
+	NUMERIC_SIGN_POS = 1,
+	NUMERIC_SIGN_PINF = 2,
+	NUMERIC_SIGN_NAN = 3,
+	NUMERIC_SIGN_NULL = 4,
+} NUMERIC_SIGN;
+
 
 /*
  * structure to cache metadata needed in pg_input_is_valid_common
@@ -1095,3 +1115,341 @@ any_value_transfn(PG_FUNCTION_ARGS)
 {
 	PG_RETURN_DATUM(PG_GETARG_DATUM(0));
 }
+
+/*
+ * monotonic_slope_support
+ *		Generic helper for prosupport functions that declare monotonic slopes.
+ *
+ * If the request is a SupportRequestMonotonic, fills in nslopes and slopes
+ * and returns the request pointer.  Otherwise returns NULL.
+ */
+static Datum
+monotonic_slope_support(Node *rawreq, int nslopes,
+						const MonotonicFunction *slopes)
+{
+	if (IsA(rawreq, SupportRequestMonotonic))
+	{
+		SupportRequestMonotonic *req = (SupportRequestMonotonic *) rawreq;
+
+		req->nslopes = nslopes;
+		req->slopes = slopes;
+		return PointerGetDatum(req);
+	}
+
+	return PointerGetDatum(NULL);
+}
+
+
+static bool
+get_2slope_args(Node *rawreq, Node **arg0, Node **arg1)
+{
+	SupportRequestMonotonic *req = (SupportRequestMonotonic *) rawreq;
+	List	   *args;
+
+	if (!IsA(rawreq, SupportRequestMonotonic))
+		return false;
+	if (IsA(req->expr, FuncExpr))
+		args = ((FuncExpr *) req->expr)->args;
+	else if (IsA(req->expr, OpExpr))
+		args = ((OpExpr *) req->expr)->args;
+	else
+		return false;
+	if (list_length(args) < 2)
+		return false;
+	*arg0 = (Node *) linitial(args);
+	*arg1 = (Node *) lsecond(args);
+	return true;
+}
+
+/*
+ * get_const_sign
+ *  Helper to determine the sign of a numeric constant.
+ *  It will classify a number according
+ */
+static inline NUMERIC_SIGN
+get_const_sign(Const *constval)
+{
+	if (constval->constisnull)
+		return NUMERIC_SIGN_NULL;
+
+	switch (constval->consttype)
+	{
+		case INT2OID:
+			{
+				int16		val = DatumGetInt16(constval->constvalue);
+
+				return (val > 0) ? 1 : (val < 0) ? -1 : 0;
+			}
+		case INT4OID:
+			{
+				int32		val = DatumGetInt32(constval->constvalue);
+
+				return (val > 0) ? 1 : (val < 0) ? -1 : 0;
+			}
+		case INT8OID:
+			{
+				int64		val = DatumGetInt64(constval->constvalue);
+
+				return (val > 0) ? 1 : (val < 0) ? -1 : 0;
+			}
+		case FLOAT4OID:
+			{
+				float4		val = DatumGetFloat4(constval->constvalue);
+
+				if (isnan(val))
+					return NUMERIC_SIGN_NAN;
+				if (isinf(val))
+					return val > 0 ? NUMERIC_SIGN_PINF : NUMERIC_SIGN_NINF;
+				else if (val == 0)
+					return NUMERIC_SIGN_ZERO;
+				else
+					return val > 0 ? NUMERIC_SIGN_POS : NUMERIC_SIGN_NEG;
+			}
+		case FLOAT8OID:
+			{
+				float8		val = DatumGetFloat8(constval->constvalue);
+
+				if (isnan(val))
+					return NUMERIC_SIGN_NAN;
+				if (isinf(val))
+					return val > 0 ? NUMERIC_SIGN_PINF : NUMERIC_SIGN_NINF;
+				else if (val == 0)
+					return NUMERIC_SIGN_ZERO;
+				else
+					return val > 0 ? NUMERIC_SIGN_POS : NUMERIC_SIGN_NEG;
+			}
+		case NUMERICOID:
+			{
+				Numeric		num = DatumGetNumeric(constval->constvalue);
+				Datum		result;
+				Numeric		sign_num;
+				int			val_sign;
+
+				if (numeric_is_nan(num))
+					return NUMERIC_SIGN_NAN;
+
+				result = DirectFunctionCall1(numeric_sign, NumericGetDatum(num));
+				sign_num = DatumGetNumeric(result);
+				val_sign = numeric_int4_safe(sign_num, NULL);
+				if (numeric_is_inf(num))
+					return val_sign == 1 ? NUMERIC_SIGN_PINF : NUMERIC_SIGN_NINF;
+				else
+					return (enum NUMERIC_SIGN) val_sign;
+			}
+		default:
+			return 0;
+	}
+}
+
+static const MonotonicFunction asc_slope[2] = {MONOTONICFUNC_INCREASING, MONOTONICFUNC_INCREASING};
+static const MonotonicFunction desc_slope[2] = {MONOTONICFUNC_DECREASING, MONOTONICFUNC_DECREASING};
+static const MonotonicFunction flat_slope[2] = {MONOTONICFUNC_BOTH, MONOTONICFUNC_BOTH};
+static const MonotonicFunction diff_slope[2] = {MONOTONICFUNC_INCREASING, MONOTONICFUNC_DECREASING};
+
+
+
+/*
+ * Prosupport: f(x, ...) is monotonically increasing in x.
+ */
+Datum
+arg0_asc_slope_support(PG_FUNCTION_ARGS)
+{
+	static const MonotonicFunction pattern[1] = {MONOTONICFUNC_INCREASING};
+
+	return monotonic_slope_support((Node *) PG_GETARG_POINTER(0),
+								   lengthof(pattern), pattern);
+}
+
+ /*
+  * Prosupport: f(x, ...) is monotonically decreasing in x.
+  */
+Datum
+arg0_desc_slope_support(PG_FUNCTION_ARGS)
+{
+	static const MonotonicFunction pattern[1] = {MONOTONICFUNC_DECREASING};
+
+	return monotonic_slope_support((Node *) PG_GETARG_POINTER(0),
+								   lengthof(pattern), pattern);
+}
+
+ /*
+  * Prosupport: f(a, x, ...) is monotonically increasing in x.
+  */
+Datum
+arg1_asc_slope_support(PG_FUNCTION_ARGS)
+{
+	static const MonotonicFunction pattern[2] = {MONOTONICFUNC_NONE,
+	MONOTONICFUNC_INCREASING};
+
+	return monotonic_slope_support((Node *) PG_GETARG_POINTER(0),
+								   lengthof(pattern), pattern);
+}
+
+/*
+ * diff_slope_support
+ *		Prosupport: f(x, y) = x - y is increasing in x, decreasing in y.
+ */
+Datum
+diff_slope_support(PG_FUNCTION_ARGS)
+{
+	Node	   *rawreq = (Node *) PG_GETARG_POINTER(0);
+	Node	   *arg0;
+	Node	   *arg1;
+
+	if (!get_2slope_args(rawreq, &arg0, &arg1))
+		PG_RETURN_POINTER(NULL);
+
+	if (IsA(arg0, Const))
+	{
+		switch (get_const_sign((Const *) arg0))
+		{
+			case NUMERIC_SIGN_NINF:
+			case NUMERIC_SIGN_PINF:
+			case NUMERIC_SIGN_NAN:
+				return monotonic_slope_support(rawreq, 2, flat_slope);
+			default:
+				break;
+		}
+	}
+	else if (IsA(arg1, Const))
+	{
+		switch (get_const_sign((Const *) arg1))
+		{
+			case NUMERIC_SIGN_NINF:
+			case NUMERIC_SIGN_PINF:
+			case NUMERIC_SIGN_NAN:
+				return monotonic_slope_support(rawreq, 2, flat_slope);
+			default:
+				break;
+		}
+	}
+
+	return monotonic_slope_support(rawreq, 2, diff_slope);
+}
+
+/*
+ * addition_slope_support
+ *		Prosupport: f(x, y) = x + y is increasing in both x and y.
+ */
+Datum
+addition_slope_support(PG_FUNCTION_ARGS)
+{
+	Node	   *rawreq = (Node *) PG_GETARG_POINTER(0);
+	Node	   *arg0;
+	Node	   *arg1;
+
+	if (!get_2slope_args(rawreq, &arg0, &arg1))
+		PG_RETURN_POINTER(NULL);
+
+	if (IsA(arg0, Const))
+	{
+		switch (get_const_sign((Const *) arg0))
+		{
+			case NUMERIC_SIGN_PINF:
+			case NUMERIC_SIGN_NINF:
+			case NUMERIC_SIGN_NAN:
+				return monotonic_slope_support(rawreq, 2, flat_slope);
+			default:
+				break;
+		}
+	}
+	else if (IsA(arg1, Const))
+	{
+		switch (get_const_sign((Const *) arg1))
+		{
+			case NUMERIC_SIGN_PINF:
+			case NUMERIC_SIGN_NINF:
+			case NUMERIC_SIGN_NAN:
+				return monotonic_slope_support(rawreq, 2, flat_slope);
+			default:
+				break;
+		}
+	}
+
+	return monotonic_slope_support(rawreq, 2, asc_slope);
+}
+
+/*
+ * multiply_slope_support
+ *		Prosupport: x * c is increasing if c > 0, decreasing if c < 0.
+ *		Similarly for c * x.
+ *
+ * For multiplication, the monotonicity depends on the sign of the constant:
+ * - x * positive_const: increasing in x
+ * - x * negative_const: decreasing in x
+ * - x * 0: not monotonic (constant result)
+ */
+Datum
+multiply_slope_support(PG_FUNCTION_ARGS)
+{
+	Node	   *rawreq = (Node *) PG_GETARG_POINTER(0);
+	Const	   *constval;
+	Node	   *arg0;
+	Node	   *arg1;
+
+	if (!get_2slope_args(rawreq, &arg0, &arg1))
+		PG_RETURN_POINTER(NULL);
+
+	if (IsA(arg0, Const))
+		constval = (Const *) arg0;
+	else if (IsA(arg1, Const))
+		constval = (Const *) arg1;
+	else
+		PG_RETURN_POINTER(NULL);
+
+	switch (get_const_sign(constval))
+	{
+		case NUMERIC_SIGN_POS:
+			return monotonic_slope_support(rawreq, 2, asc_slope);
+		case NUMERIC_SIGN_NEG:
+			return monotonic_slope_support(rawreq, 2, desc_slope);
+		case NUMERIC_SIGN_NAN:
+			return monotonic_slope_support(rawreq, 2, flat_slope);
+		case NUMERIC_SIGN_ZERO:
+			return monotonic_slope_support(rawreq, 2, flat_slope);
+		default:
+			PG_RETURN_POINTER(NULL);
+	}
+
+}
+
+/*
+ * divide_slope_support
+ *		Prosupport: x / c is increasing if c > 0, decreasing if c < 0.
+ *
+ * Division by a constant has the same monotonicity as multiplication:
+ * - x / positive_const: increasing in x
+ * - x / negative_const: decreasing in x
+ * - x / 0: undefined (not monotonic)
+ */
+Datum
+divide_slope_support(PG_FUNCTION_ARGS)
+{
+	Node	   *rawreq = (Node *) PG_GETARG_POINTER(0);
+	Const	   *constval;
+	Node	   *arg0;
+	Node	   *arg1;
+
+	if (!get_2slope_args(rawreq, &arg0, &arg1))
+		PG_RETURN_POINTER(NULL);
+
+	if (!IsA(arg1, Const))
+		PG_RETURN_POINTER(NULL);
+
+	constval = (Const *) arg1;
+	switch (get_const_sign(constval))
+	{
+		case NUMERIC_SIGN_POS:
+			return monotonic_slope_support(rawreq, 2, asc_slope);
+		case NUMERIC_SIGN_NEG:
+			return monotonic_slope_support(rawreq, 2, desc_slope);
+		case NUMERIC_SIGN_NAN:
+			return monotonic_slope_support(rawreq, 2, flat_slope);
+		case NUMERIC_SIGN_PINF:
+		case NUMERIC_SIGN_NINF:
+			return monotonic_slope_support(rawreq, 2, flat_slope);
+		default:
+			PG_RETURN_POINTER(NULL);
+	}
+	PG_RETURN_POINTER(NULL);
+}
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 1c55a4dea34..32ec206806e 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -420,8 +420,8 @@
   proargtypes => 'internal oid internal int2 internal',
   prosrc => 'areajoinsel' },
 { oid => '141',
-  proname => 'int4mul', prorettype => 'int4', proargtypes => 'int4 int4',
-  prosrc => 'int4mul' },
+  proname => 'int4mul', prosupport => 'multiply_slope_support',
+  prorettype => 'int4', proargtypes => 'int4 int4', prosrc => 'int4mul' },
 { oid => '144',
   proname => 'int4ne', proleakproof => 't', prorettype => 'bool',
   proargtypes => 'int4 int4', prosrc => 'int4ne' },
@@ -447,14 +447,14 @@
   proname => 'int2ge', proleakproof => 't', prorettype => 'bool',
   proargtypes => 'int2 int2', prosrc => 'int2ge' },
 { oid => '152',
-  proname => 'int2mul', prorettype => 'int2', proargtypes => 'int2 int2',
-  prosrc => 'int2mul' },
+  proname => 'int2mul', prosupport => 'multiply_slope_support',
+  prorettype => 'int2', proargtypes => 'int2 int2', prosrc => 'int2mul' },
 { oid => '153',
-  proname => 'int2div', prorettype => 'int2', proargtypes => 'int2 int2',
-  prosrc => 'int2div' },
+  proname => 'int2div', prosupport => 'divide_slope_support',
+  prorettype => 'int2', proargtypes => 'int2 int2', prosrc => 'int2div' },
 { oid => '154',
-  proname => 'int4div', prorettype => 'int4', proargtypes => 'int4 int4',
-  prosrc => 'int4div' },
+  proname => 'int4div', prosupport => 'divide_slope_support',
+  prorettype => 'int4', proargtypes => 'int4 int4', prosrc => 'int4div' },
 { oid => '155',
   proname => 'int2mod', prorettype => 'int2', proargtypes => 'int2 int2',
   prosrc => 'int2mod' },
@@ -501,41 +501,45 @@
   proname => 'int42ge', proleakproof => 't', prorettype => 'bool',
   proargtypes => 'int4 int2', prosrc => 'int42ge' },
 { oid => '170',
-  proname => 'int24mul', prorettype => 'int4', proargtypes => 'int2 int4',
+  proname => 'int24mul', prosupport => 'multiply_slope_support',
+  prorettype => 'int4', proargtypes => 'int2 int4',
   prosrc => 'int24mul' },
 { oid => '171',
-  proname => 'int42mul', prorettype => 'int4', proargtypes => 'int4 int2',
+  proname => 'int42mul', prosupport => 'multiply_slope_support',
+  prorettype => 'int4', proargtypes => 'int4 int2',
   prosrc => 'int42mul' },
 { oid => '172',
-  proname => 'int24div', prorettype => 'int4', proargtypes => 'int2 int4',
+  proname => 'int24div', prosupport => 'divide_slope_support',
+  prorettype => 'int4', proargtypes => 'int2 int4',
   prosrc => 'int24div' },
 { oid => '173',
-  proname => 'int42div', prorettype => 'int4', proargtypes => 'int4 int2',
+  proname => 'int42div', prosupport => 'divide_slope_support',
+  prorettype => 'int4', proargtypes => 'int4 int2',
   prosrc => 'int42div' },
 { oid => '176',
-  proname => 'int2pl', prorettype => 'int2', proargtypes => 'int2 int2',
-  prosrc => 'int2pl' },
+  proname => 'int2pl', prosupport => 'addition_slope_support',
+  prorettype => 'int2', proargtypes => 'int2 int2', prosrc => 'int2pl' },
 { oid => '177',
-  proname => 'int4pl', prorettype => 'int4', proargtypes => 'int4 int4',
-  prosrc => 'int4pl' },
+  proname => 'int4pl', prosupport => 'addition_slope_support',
+  prorettype => 'int4', proargtypes => 'int4 int4', prosrc => 'int4pl' },
 { oid => '178',
-  proname => 'int24pl', prorettype => 'int4', proargtypes => 'int2 int4',
-  prosrc => 'int24pl' },
+  proname => 'int24pl', prosupport => 'addition_slope_support',
+  prorettype => 'int4', proargtypes => 'int2 int4', prosrc => 'int24pl' },
 { oid => '179',
-  proname => 'int42pl', prorettype => 'int4', proargtypes => 'int4 int2',
-  prosrc => 'int42pl' },
+  proname => 'int42pl', prosupport => 'addition_slope_support',
+  prorettype => 'int4', proargtypes => 'int4 int2', prosrc => 'int42pl' },
 { oid => '180',
-  proname => 'int2mi', prorettype => 'int2', proargtypes => 'int2 int2',
-  prosrc => 'int2mi' },
+  proname => 'int2mi', prosupport => 'diff_slope_support',
+  prorettype => 'int2', proargtypes => 'int2 int2', prosrc => 'int2mi' },
 { oid => '181',
-  proname => 'int4mi', prorettype => 'int4', proargtypes => 'int4 int4',
-  prosrc => 'int4mi' },
+  proname => 'int4mi', prosupport => 'diff_slope_support',
+  prorettype => 'int4', proargtypes => 'int4 int4', prosrc => 'int4mi' },
 { oid => '182',
-  proname => 'int24mi', prorettype => 'int4', proargtypes => 'int2 int4',
-  prosrc => 'int24mi' },
+  proname => 'int24mi', prosupport => 'diff_slope_support',
+  prorettype => 'int4', proargtypes => 'int2 int4', prosrc => 'int24mi' },
 { oid => '183',
-  proname => 'int42mi', prorettype => 'int4', proargtypes => 'int4 int2',
-  prosrc => 'int42mi' },
+  proname => 'int42mi', prosupport => 'diff_slope_support',
+  prorettype => 'int4', proargtypes => 'int4 int2', prosrc => 'int42mi' },
 { oid => '184',
   proname => 'oideq', proleakproof => 't', prorettype => 'bool',
   proargtypes => 'oid oid', prosrc => 'oideq' },
@@ -590,20 +594,20 @@
   proname => 'float4out', prorettype => 'cstring', proargtypes => 'float4',
   prosrc => 'float4out' },
 { oid => '202',
-  proname => 'float4mul', prorettype => 'float4',
-  proargtypes => 'float4 float4', prosrc => 'float4mul' },
+  proname => 'float4mul', prosupport => 'multiply_slope_support',
+  prorettype => 'float4', proargtypes => 'float4 float4', prosrc => 'float4mul' },
 { oid => '203',
-  proname => 'float4div', prorettype => 'float4',
-  proargtypes => 'float4 float4', prosrc => 'float4div' },
+  proname => 'float4div', prosupport => 'divide_slope_support',
+  prorettype => 'float4', proargtypes => 'float4 float4', prosrc => 'float4div' },
 { oid => '204',
-  proname => 'float4pl', prorettype => 'float4', proargtypes => 'float4 float4',
-  prosrc => 'float4pl' },
+  proname => 'float4pl', prosupport => 'addition_slope_support',
+  prorettype => 'float4', proargtypes => 'float4 float4', prosrc => 'float4pl' },
 { oid => '205',
-  proname => 'float4mi', prorettype => 'float4', proargtypes => 'float4 float4',
-  prosrc => 'float4mi' },
+  proname => 'float4mi', prosupport => 'diff_slope_support',
+  prorettype => 'float4', proargtypes => 'float4 float4', prosrc => 'float4mi' },
 { oid => '206',
-  proname => 'float4um', prorettype => 'float4', proargtypes => 'float4',
-  prosrc => 'float4um' },
+  proname => 'float4um', prosupport => 'arg0_desc_slope_support',
+  prorettype => 'float4', proargtypes => 'float4', prosrc => 'float4um' },
 { oid => '207',
   proname => 'float4abs', prorettype => 'float4', proargtypes => 'float4',
   prosrc => 'float4abs' },
@@ -618,11 +622,11 @@
   proargtypes => 'float4 float4', prosrc => 'float4smaller' },
 
 { oid => '212',
-  proname => 'int4um', prorettype => 'int4', proargtypes => 'int4',
-  prosrc => 'int4um' },
+  proname => 'int4um', prosupport => 'arg0_desc_slope_support',
+  prorettype => 'int4', proargtypes => 'int4', prosrc => 'int4um' },
 { oid => '213',
-  proname => 'int2um', prorettype => 'int2', proargtypes => 'int2',
-  prosrc => 'int2um' },
+  proname => 'int2um', prosupport => 'arg0_desc_slope_support',
+  prorettype => 'int2', proargtypes => 'int2', prosrc => 'int2um' },
 
 { oid => '214', descr => 'I/O',
   proname => 'float8in', prorettype => 'float8', proargtypes => 'cstring',
@@ -631,20 +635,20 @@
   proname => 'float8out', prorettype => 'cstring', proargtypes => 'float8',
   prosrc => 'float8out' },
 { oid => '216',
-  proname => 'float8mul', prorettype => 'float8',
-  proargtypes => 'float8 float8', prosrc => 'float8mul' },
+  proname => 'float8mul', prosupport => 'multiply_slope_support',
+  prorettype => 'float8', proargtypes => 'float8 float8', prosrc => 'float8mul' },
 { oid => '217',
-  proname => 'float8div', prorettype => 'float8',
-  proargtypes => 'float8 float8', prosrc => 'float8div' },
+  proname => 'float8div', prosupport => 'divide_slope_support',
+  prorettype => 'float8', proargtypes => 'float8 float8', prosrc => 'float8div' },
 { oid => '218',
-  proname => 'float8pl', prorettype => 'float8', proargtypes => 'float8 float8',
-  prosrc => 'float8pl' },
+  proname => 'float8pl', prosupport => 'addition_slope_support',
+  prorettype => 'float8', proargtypes => 'float8 float8', prosrc => 'float8pl' },
 { oid => '219',
-  proname => 'float8mi', prorettype => 'float8', proargtypes => 'float8 float8',
-  prosrc => 'float8mi' },
+  proname => 'float8mi', prosupport => 'diff_slope_support',
+  prorettype => 'float8', proargtypes => 'float8 float8', prosrc => 'float8mi' },
 { oid => '220',
-  proname => 'float8um', prorettype => 'float8', proargtypes => 'float8',
-  prosrc => 'float8um' },
+  proname => 'float8um', prosupport => 'arg0_desc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8', prosrc => 'float8um' },
 { oid => '221',
   proname => 'float8abs', prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'float8abs' },
@@ -675,14 +679,15 @@
   proname => 'dtrunc', prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dtrunc' },
 { oid => '2308', descr => 'nearest integer >= value',
-  proname => 'ceil', prorettype => 'float8', proargtypes => 'float8',
-  prosrc => 'dceil' },
+  proname => 'ceil', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8', prosrc => 'dceil' },
 { oid => '2320', descr => 'nearest integer >= value',
-  proname => 'ceiling', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'ceiling', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dceil' },
 { oid => '2309', descr => 'nearest integer <= value',
-  proname => 'floor', prorettype => 'float8', proargtypes => 'float8',
-  prosrc => 'dfloor' },
+  proname => 'floor', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8', prosrc => 'dfloor' },
 { oid => '2310', descr => 'sign of value',
   proname => 'sign', prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dsign' },
@@ -777,28 +782,36 @@
   prosrc => 'inter_lb' },
 
 { oid => '279',
-  proname => 'float48mul', prorettype => 'float8',
+  proname => 'float48mul', prosupport => 'multiply_slope_support',
+  prorettype => 'float8',
   proargtypes => 'float4 float8', prosrc => 'float48mul' },
 { oid => '280',
-  proname => 'float48div', prorettype => 'float8',
+  proname => 'float48div', prosupport => 'divide_slope_support',
+  prorettype => 'float8',
   proargtypes => 'float4 float8', prosrc => 'float48div' },
 { oid => '281',
-  proname => 'float48pl', prorettype => 'float8',
+  proname => 'float48pl', prosupport => 'addition_slope_support',
+  prorettype => 'float8',
   proargtypes => 'float4 float8', prosrc => 'float48pl' },
 { oid => '282',
-  proname => 'float48mi', prorettype => 'float8',
+  proname => 'float48mi', prosupport => 'diff_slope_support',
+  prorettype => 'float8',
   proargtypes => 'float4 float8', prosrc => 'float48mi' },
 { oid => '283',
-  proname => 'float84mul', prorettype => 'float8',
+  proname => 'float84mul', prosupport => 'multiply_slope_support',
+  prorettype => 'float8',
   proargtypes => 'float8 float4', prosrc => 'float84mul' },
 { oid => '284',
-  proname => 'float84div', prorettype => 'float8',
+  proname => 'float84div', prosupport => 'divide_slope_support',
+  prorettype => 'float8',
   proargtypes => 'float8 float4', prosrc => 'float84div' },
 { oid => '285',
-  proname => 'float84pl', prorettype => 'float8',
+  proname => 'float84pl', prosupport => 'addition_slope_support',
+  prorettype => 'float8',
   proargtypes => 'float8 float4', prosrc => 'float84pl' },
 { oid => '286',
-  proname => 'float84mi', prorettype => 'float8',
+  proname => 'float84mi', prosupport => 'diff_slope_support',
+  prorettype => 'float8',
   proargtypes => 'float8 float4', prosrc => 'float84mi' },
 
 { oid => '287',
@@ -1378,20 +1391,20 @@
   proname => 'int8out', prorettype => 'cstring', proargtypes => 'int8',
   prosrc => 'int8out' },
 { oid => '462',
-  proname => 'int8um', prorettype => 'int8', proargtypes => 'int8',
-  prosrc => 'int8um' },
+  proname => 'int8um', prosupport => 'arg0_desc_slope_support',
+  prorettype => 'int8', proargtypes => 'int8', prosrc => 'int8um' },
 { oid => '463',
-  proname => 'int8pl', prorettype => 'int8', proargtypes => 'int8 int8',
-  prosrc => 'int8pl' },
+  proname => 'int8pl', prosupport => 'addition_slope_support',
+  prorettype => 'int8', proargtypes => 'int8 int8', prosrc => 'int8pl' },
 { oid => '464',
-  proname => 'int8mi', prorettype => 'int8', proargtypes => 'int8 int8',
-  prosrc => 'int8mi' },
+  proname => 'int8mi', prosupport => 'diff_slope_support',
+  prorettype => 'int8', proargtypes => 'int8 int8', prosrc => 'int8mi' },
 { oid => '465',
-  proname => 'int8mul', prorettype => 'int8', proargtypes => 'int8 int8',
-  prosrc => 'int8mul' },
+  proname => 'int8mul', prosupport => 'multiply_slope_support',
+  prorettype => 'int8', proargtypes => 'int8 int8', prosrc => 'int8mul' },
 { oid => '466',
-  proname => 'int8div', prorettype => 'int8', proargtypes => 'int8 int8',
-  prosrc => 'int8div' },
+  proname => 'int8div', prosupport => 'divide_slope_support',
+  prorettype => 'int8', proargtypes => 'int8 int8', prosrc => 'int8div' },
 { oid => '467',
   proname => 'int8eq', proleakproof => 't', prorettype => 'bool',
   proargtypes => 'int8 int8', prosrc => 'int8eq' },
@@ -1856,13 +1869,16 @@
 # OIDS 800 - 899
 
 { oid => '846',
-  proname => 'cash_mul_flt4', prorettype => 'money',
+  proname => 'cash_mul_flt4', prosupport => 'multiply_slope_support',
+  prorettype => 'money',
   proargtypes => 'money float4', prosrc => 'cash_mul_flt4' },
 { oid => '847',
-  proname => 'cash_div_flt4', prorettype => 'money',
+  proname => 'cash_div_flt4', prosupport => 'divide_slope_support',
+  prorettype => 'money',
   proargtypes => 'money float4', prosrc => 'cash_div_flt4' },
 { oid => '848',
-  proname => 'flt4_mul_cash', prorettype => 'money',
+  proname => 'flt4_mul_cash', prosupport => 'multiply_slope_support',
+  prorettype => 'money',
   proargtypes => 'float4 money', prosrc => 'flt4_mul_cash' },
 
 { oid => '849', descr => 'position of substring',
@@ -1917,31 +1933,40 @@
   prosrc => 'current_query' },
 
 { oid => '3399',
-  proname => 'int8_mul_cash', prorettype => 'money',
+  proname => 'int8_mul_cash', prosupport => 'multiply_slope_support',
+  prorettype => 'money',
   proargtypes => 'int8 money', prosrc => 'int8_mul_cash' },
 { oid => '862',
-  proname => 'int4_mul_cash', prorettype => 'money',
+  proname => 'int4_mul_cash', prosupport => 'multiply_slope_support',
+  prorettype => 'money',
   proargtypes => 'int4 money', prosrc => 'int4_mul_cash' },
 { oid => '863',
-  proname => 'int2_mul_cash', prorettype => 'money',
+  proname => 'int2_mul_cash', prosupport => 'multiply_slope_support',
+  prorettype => 'money',
   proargtypes => 'int2 money', prosrc => 'int2_mul_cash' },
 { oid => '3344',
-  proname => 'cash_mul_int8', prorettype => 'money',
+  proname => 'cash_mul_int8', prosupport => 'multiply_slope_support',
+  prorettype => 'money',
   proargtypes => 'money int8', prosrc => 'cash_mul_int8' },
 { oid => '3345',
-  proname => 'cash_div_int8', prorettype => 'money',
+  proname => 'cash_div_int8', prosupport => 'divide_slope_support',
+  prorettype => 'money',
   proargtypes => 'money int8', prosrc => 'cash_div_int8' },
 { oid => '864',
-  proname => 'cash_mul_int4', prorettype => 'money',
+  proname => 'cash_mul_int4', prosupport => 'multiply_slope_support',
+  prorettype => 'money',
   proargtypes => 'money int4', prosrc => 'cash_mul_int4' },
 { oid => '865',
-  proname => 'cash_div_int4', prorettype => 'money',
+  proname => 'cash_div_int4', prosupport => 'divide_slope_support',
+  prorettype => 'money',
   proargtypes => 'money int4', prosrc => 'cash_div_int4' },
 { oid => '866',
-  proname => 'cash_mul_int2', prorettype => 'money',
+  proname => 'cash_mul_int2', prosupport => 'multiply_slope_support',
+  prorettype => 'money',
   proargtypes => 'money int2', prosrc => 'cash_mul_int2' },
 { oid => '867',
-  proname => 'cash_div_int2', prorettype => 'money',
+  proname => 'cash_div_int2', prosupport => 'divide_slope_support',
+  prorettype => 'money',
   proargtypes => 'money int2', prosrc => 'cash_div_int2' },
 
 { oid => '886', descr => 'I/O',
@@ -1969,16 +1994,20 @@
   proname => 'cash_ge', proleakproof => 't', prorettype => 'bool',
   proargtypes => 'money money', prosrc => 'cash_ge' },
 { oid => '894',
-  proname => 'cash_pl', prorettype => 'money', proargtypes => 'money money',
+  proname => 'cash_pl', prosupport => 'addition_slope_support',
+  prorettype => 'money', proargtypes => 'money money',
   prosrc => 'cash_pl' },
 { oid => '895',
-  proname => 'cash_mi', prorettype => 'money', proargtypes => 'money money',
+  proname => 'cash_mi', prosupport => 'diff_slope_support',
+  prorettype => 'money', proargtypes => 'money money',
   prosrc => 'cash_mi' },
 { oid => '896',
-  proname => 'cash_mul_flt8', prorettype => 'money',
+  proname => 'cash_mul_flt8', prosupport => 'multiply_slope_support',
+  prorettype => 'money',
   proargtypes => 'money float8', prosrc => 'cash_mul_flt8' },
 { oid => '897',
-  proname => 'cash_div_flt8', prorettype => 'money',
+  proname => 'cash_div_flt8', prosupport => 'divide_slope_support',
+  prorettype => 'money',
   proargtypes => 'money float8', prosrc => 'cash_div_flt8' },
 { oid => '898', descr => 'larger of two',
   proname => 'cashlarger', prorettype => 'money', proargtypes => 'money money',
@@ -1987,13 +2016,15 @@
   proname => 'cashsmaller', prorettype => 'money', proargtypes => 'money money',
   prosrc => 'cashsmaller' },
 { oid => '919',
-  proname => 'flt8_mul_cash', prorettype => 'money',
+  proname => 'flt8_mul_cash', prosupport => 'multiply_slope_support',
+  prorettype => 'money',
   proargtypes => 'float8 money', prosrc => 'flt8_mul_cash' },
 { oid => '935', descr => 'output money amount as words',
   proname => 'cash_words', prorettype => 'text', proargtypes => 'money',
   prosrc => 'cash_words' },
 { oid => '3822',
-  proname => 'cash_div_cash', prorettype => 'float8',
+  proname => 'cash_div_cash', prosupport => 'divide_slope_support',
+  prorettype => 'float8',
   proargtypes => 'money money', prosrc => 'cash_div_cash' },
 { oid => '3823', descr => 'convert money to numeric',
   proname => 'numeric', provolatile => 's', prorettype => 'numeric',
@@ -2365,13 +2396,16 @@
   proname => 'date_smaller', prorettype => 'date', proargtypes => 'date date',
   prosrc => 'date_smaller' },
 { oid => '1140',
-  proname => 'date_mi', prorettype => 'int4', proargtypes => 'date date',
+  proname => 'date_mi', prosupport => 'diff_slope_support',
+  prorettype => 'int4', proargtypes => 'date date',
   prosrc => 'date_mi' },
 { oid => '1141',
-  proname => 'date_pli', prorettype => 'date', proargtypes => 'date int4',
+  proname => 'date_pli', prosupport => 'addition_slope_support',
+  prorettype => 'date', proargtypes => 'date int4',
   prosrc => 'date_pli' },
 { oid => '1142',
-  proname => 'date_mii', prorettype => 'date', proargtypes => 'date int4',
+  proname => 'date_mii', prosupport => 'diff_slope_support',
+  prorettype => 'date', proargtypes => 'date int4',
   prosrc => 'date_mii' },
 { oid => '1143', descr => 'I/O',
   proname => 'time_in', provolatile => 's', prorettype => 'time',
@@ -2433,7 +2467,8 @@
   proname => 'timestamptz_gt', proleakproof => 't', prorettype => 'bool',
   proargtypes => 'timestamptz timestamptz', prosrc => 'timestamp_gt' },
 { oid => '1158', descr => 'convert UNIX epoch to timestamptz',
-  proname => 'to_timestamp', prorettype => 'timestamptz',
+  proname => 'to_timestamp', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'timestamptz',
   proargtypes => 'float8', prosrc => 'float8_timestamptz' },
 { oid => '1159', descr => 'adjust timestamp to new time zone',
   proname => 'timezone', prorettype => 'timestamp',
@@ -2473,13 +2508,16 @@
   proname => 'interval_gt', proleakproof => 't', prorettype => 'bool',
   proargtypes => 'interval interval', prosrc => 'interval_gt' },
 { oid => '1168',
-  proname => 'interval_um', prorettype => 'interval', proargtypes => 'interval',
+  proname => 'interval_um',
+  prorettype => 'interval', proargtypes => 'interval',
   prosrc => 'interval_um' },
 { oid => '1169',
-  proname => 'interval_pl', prorettype => 'interval',
+  proname => 'interval_pl',
+  prorettype => 'interval',
   proargtypes => 'interval interval', prosrc => 'interval_pl' },
 { oid => '1170',
-  proname => 'interval_mi', prorettype => 'interval',
+  proname => 'interval_mi',
+  prorettype => 'interval',
   proargtypes => 'interval interval', prosrc => 'interval_mi' },
 { oid => '1171', descr => 'extract field from timestamp with time zone',
   proname => 'date_part', provolatile => 's', prorettype => 'float8',
@@ -2494,7 +2532,8 @@
   proname => 'extract', prorettype => 'numeric', proargtypes => 'text interval',
   prosrc => 'extract_interval' },
 { oid => '1174', descr => 'convert date to timestamp with time zone',
-  proname => 'timestamptz', provolatile => 's', prorettype => 'timestamptz',
+  proname => 'timestamptz', prosupport => 'arg0_asc_slope_support',
+  provolatile => 's', prorettype => 'timestamptz',
   proargtypes => 'date', prosrc => 'date_timestamptz' },
 { oid => '2711',
   descr => 'promote groups of 24 hours to numbers of days and promote groups of 30 days to numbers of months',
@@ -2507,11 +2546,13 @@
   proname => 'justify_days', prorettype => 'interval',
   proargtypes => 'interval', prosrc => 'interval_justify_days' },
 { oid => '1176', descr => 'convert date and time to timestamp with time zone',
-  proname => 'timestamptz', prolang => 'sql', provolatile => 's',
+  proname => 'timestamptz', prosupport => 'arg0_asc_slope_support',
+  prolang => 'sql', provolatile => 's',
   prorettype => 'timestamptz', proargtypes => 'date time',
   prosrc => 'see system_functions.sql' },
 { oid => '1178', descr => 'convert timestamp with time zone to date',
-  proname => 'date', provolatile => 's', prorettype => 'date',
+  proname => 'date', prosupport => 'arg0_asc_slope_support',
+  provolatile => 's', prorettype => 'date',
   proargtypes => 'timestamptz', prosrc => 'timestamptz_date' },
 { oid => '1181',
   descr => 'age of a transaction ID, in transactions before current transaction',
@@ -2523,10 +2564,12 @@
   proargtypes => 'xid', prosrc => 'mxid_age' },
 
 { oid => '1188',
-  proname => 'timestamptz_mi', prorettype => 'interval',
+  proname => 'timestamptz_mi', prosupport => 'diff_slope_support',
+  prorettype => 'interval',
   proargtypes => 'timestamptz timestamptz', prosrc => 'timestamp_mi' },
 { oid => '1189',
-  proname => 'timestamptz_pl_interval', provolatile => 's',
+  proname => 'timestamptz_pl_interval',
+  provolatile => 's',
   prorettype => 'timestamptz', proargtypes => 'timestamptz interval',
   prosrc => 'timestamptz_pl_interval' },
 { oid => '6221', descr => 'add interval to timestamp with time zone',
@@ -2538,7 +2581,8 @@
   proargtypes => 'timestamptz interval text',
   prosrc => 'timestamptz_pl_interval_at_zone' },
 { oid => '1190',
-  proname => 'timestamptz_mi_interval', provolatile => 's',
+  proname => 'timestamptz_mi_interval',
+  provolatile => 's',
   prorettype => 'timestamptz', proargtypes => 'timestamptz interval',
   prosrc => 'timestamptz_mi_interval' },
 { oid => '6223', descr => 'subtract interval from timestamp with time zone',
@@ -2591,15 +2635,17 @@
 
 { oid => '1217',
   descr => 'truncate timestamp with time zone to specified units',
-  proname => 'date_trunc', provolatile => 's', prorettype => 'timestamptz',
+  proname => 'date_trunc', prosupport => 'arg1_asc_slope_support',
+  provolatile => 's', prorettype => 'timestamptz',
   proargtypes => 'text timestamptz', prosrc => 'timestamptz_trunc' },
 { oid => '1284',
   descr => 'truncate timestamp with time zone to specified units in specified time zone',
-  proname => 'date_trunc', prorettype => 'timestamptz',
+  proname => 'date_trunc', prosupport => 'arg1_asc_slope_support',
+  prorettype => 'timestamptz',
   proargtypes => 'text timestamptz text', prosrc => 'timestamptz_trunc_zone' },
 { oid => '1218', descr => 'truncate interval to specified units',
-  proname => 'date_trunc', prorettype => 'interval',
-  proargtypes => 'text interval', prosrc => 'interval_trunc' },
+  proname => 'date_trunc',
+  prorettype => 'interval', proargtypes => 'text interval', prosrc => 'interval_trunc' },
 
 { oid => '1219', descr => 'increment',
   proname => 'int8inc', prorettype => 'int8', proargtypes => 'int8',
@@ -2651,8 +2697,9 @@
   proname => 'overlaps', proisstrict => 'f', prorettype => 'bool',
   proargtypes => 'timetz timetz timetz timetz', prosrc => 'overlaps_timetz' },
 { oid => '1272',
-  proname => 'datetime_pl', prorettype => 'timestamp',
-  proargtypes => 'date time', prosrc => 'datetime_timestamp' },
+  proname => 'datetime_pl', prosupport => 'addition_slope_support',
+  prorettype => 'timestamp', proargtypes => 'date time',
+  prosrc => 'datetime_timestamp' },
 { oid => '1273', descr => 'extract field from time with time zone',
   proname => 'date_part', prorettype => 'float8', proargtypes => 'text timetz',
   prosrc => 'timetz_part' },
@@ -2660,53 +2707,69 @@
   proname => 'extract', prorettype => 'numeric', proargtypes => 'text timetz',
   prosrc => 'extract_timetz' },
 { oid => '1274',
-  proname => 'int84pl', prorettype => 'int8', proargtypes => 'int8 int4',
+  proname => 'int84pl', prosupport => 'addition_slope_support',
+  prorettype => 'int8', proargtypes => 'int8 int4',
   prosrc => 'int84pl' },
 { oid => '1275',
-  proname => 'int84mi', prorettype => 'int8', proargtypes => 'int8 int4',
+  proname => 'int84mi', prosupport => 'diff_slope_support',
+  prorettype => 'int8', proargtypes => 'int8 int4',
   prosrc => 'int84mi' },
 { oid => '1276',
-  proname => 'int84mul', prorettype => 'int8', proargtypes => 'int8 int4',
+  proname => 'int84mul', prosupport => 'multiply_slope_support',
+  prorettype => 'int8', proargtypes => 'int8 int4',
   prosrc => 'int84mul' },
 { oid => '1277',
-  proname => 'int84div', prorettype => 'int8', proargtypes => 'int8 int4',
+  proname => 'int84div', prosupport => 'divide_slope_support',
+  prorettype => 'int8', proargtypes => 'int8 int4',
   prosrc => 'int84div' },
 { oid => '1278',
-  proname => 'int48pl', prorettype => 'int8', proargtypes => 'int4 int8',
+  proname => 'int48pl', prosupport => 'addition_slope_support',
+  prorettype => 'int8', proargtypes => 'int4 int8',
   prosrc => 'int48pl' },
 { oid => '1279',
-  proname => 'int48mi', prorettype => 'int8', proargtypes => 'int4 int8',
+  proname => 'int48mi', prosupport => 'diff_slope_support',
+  prorettype => 'int8', proargtypes => 'int4 int8',
   prosrc => 'int48mi' },
 { oid => '1280',
-  proname => 'int48mul', prorettype => 'int8', proargtypes => 'int4 int8',
+  proname => 'int48mul', prosupport => 'multiply_slope_support',
+  prorettype => 'int8', proargtypes => 'int4 int8',
   prosrc => 'int48mul' },
 { oid => '1281',
-  proname => 'int48div', prorettype => 'int8', proargtypes => 'int4 int8',
+  proname => 'int48div', prosupport => 'divide_slope_support',
+  prorettype => 'int8', proargtypes => 'int4 int8',
   prosrc => 'int48div' },
 
 { oid => '837',
-  proname => 'int82pl', prorettype => 'int8', proargtypes => 'int8 int2',
+  proname => 'int82pl', prosupport => 'addition_slope_support',
+  prorettype => 'int8', proargtypes => 'int8 int2',
   prosrc => 'int82pl' },
 { oid => '838',
-  proname => 'int82mi', prorettype => 'int8', proargtypes => 'int8 int2',
+  proname => 'int82mi', prosupport => 'diff_slope_support',
+  prorettype => 'int8', proargtypes => 'int8 int2',
   prosrc => 'int82mi' },
 { oid => '839',
-  proname => 'int82mul', prorettype => 'int8', proargtypes => 'int8 int2',
+  proname => 'int82mul', prosupport => 'multiply_slope_support',
+  prorettype => 'int8', proargtypes => 'int8 int2',
   prosrc => 'int82mul' },
 { oid => '840',
-  proname => 'int82div', prorettype => 'int8', proargtypes => 'int8 int2',
+  proname => 'int82div', prosupport => 'divide_slope_support',
+  prorettype => 'int8', proargtypes => 'int8 int2',
   prosrc => 'int82div' },
 { oid => '841',
-  proname => 'int28pl', prorettype => 'int8', proargtypes => 'int2 int8',
+  proname => 'int28pl', prosupport => 'addition_slope_support',
+  prorettype => 'int8', proargtypes => 'int2 int8',
   prosrc => 'int28pl' },
 { oid => '942',
-  proname => 'int28mi', prorettype => 'int8', proargtypes => 'int2 int8',
+  proname => 'int28mi', prosupport => 'diff_slope_support',
+  prorettype => 'int8', proargtypes => 'int2 int8',
   prosrc => 'int28mi' },
 { oid => '943',
-  proname => 'int28mul', prorettype => 'int8', proargtypes => 'int2 int8',
+  proname => 'int28mul', prosupport => 'multiply_slope_support',
+  prorettype => 'int8', proargtypes => 'int2 int8',
   prosrc => 'int28mul' },
 { oid => '948',
-  proname => 'int28div', prorettype => 'int8', proargtypes => 'int2 int8',
+  proname => 'int28div', prosupport => 'divide_slope_support',
+  prorettype => 'int8', proargtypes => 'int2 int8',
   prosrc => 'int28div' },
 
 { oid => '1287', descr => 'convert int8 to oid',
@@ -2767,13 +2830,16 @@
   prosrc => 'hashtidextended' },
 
 { oid => '1296',
-  proname => 'timedate_pl', prolang => 'sql', prorettype => 'timestamp',
+  proname => 'timedate_pl', prosupport => 'arg1_asc_slope_support',
+  prolang => 'sql', prorettype => 'timestamp',
   proargtypes => 'time date', prosrc => 'see system_functions.sql' },
 { oid => '1297',
-  proname => 'datetimetz_pl', prorettype => 'timestamptz',
+  proname => 'datetimetz_pl', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'timestamptz',
   proargtypes => 'date timetz', prosrc => 'datetimetz_timestamptz' },
 { oid => '1298',
-  proname => 'timetzdate_pl', prolang => 'sql', prorettype => 'timestamptz',
+  proname => 'timetzdate_pl', prosupport => 'arg1_asc_slope_support',
+  prolang => 'sql', prorettype => 'timestamptz',
   proargtypes => 'timetz date', prosrc => 'see system_functions.sql' },
 { oid => '1299', descr => 'current transaction time',
   proname => 'now', provolatile => 's', prorettype => 'timestamptz',
@@ -2883,32 +2949,40 @@
   proargtypes => 'xid int4', prosrc => 'xidneq' },
 
 { oid => '1326',
-  proname => 'interval_div', prorettype => 'interval',
+  proname => 'interval_div',
+  prorettype => 'interval',
   proargtypes => 'interval float8', prosrc => 'interval_div' },
 
 { oid => '1339', descr => 'base 10 logarithm',
   proname => 'dlog10', prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dlog10' },
 { oid => '1340', descr => 'base 10 logarithm',
-  proname => 'log', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'log', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dlog10' },
 { oid => '1194', descr => 'base 10 logarithm',
-  proname => 'log10', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'log10', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dlog10' },
 { oid => '1341', descr => 'natural logarithm',
-  proname => 'ln', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'ln', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dlog1' },
 { oid => '1342', descr => 'round to nearest integer',
-  proname => 'round', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'round', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dround' },
 { oid => '1343', descr => 'truncate to integer',
-  proname => 'trunc', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'trunc', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dtrunc' },
 { oid => '1344', descr => 'square root',
-  proname => 'sqrt', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'sqrt', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dsqrt' },
 { oid => '1345', descr => 'cube root',
-  proname => 'cbrt', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'cbrt', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dcbrt' },
 { oid => '1346', descr => 'exponentiation',
   proname => 'pow', prorettype => 'float8', proargtypes => 'float8 float8',
@@ -2917,7 +2991,8 @@
   proname => 'power', prorettype => 'float8', proargtypes => 'float8 float8',
   prosrc => 'dpow' },
 { oid => '1347', descr => 'natural exponential (e^x)',
-  proname => 'exp', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'exp', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dexp' },
 
 # This form of obj_description is now deprecated, since it will fail if
@@ -2966,7 +3041,8 @@
   proargtypes => 'timetz timetz', prosrc => 'timetz_cmp' },
 { oid => '1359',
   descr => 'convert date and time with time zone to timestamp with time zone',
-  proname => 'timestamptz', prorettype => 'timestamptz',
+  proname => 'timestamptz', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'timestamptz',
   proargtypes => 'date timetz', prosrc => 'datetimetz_timestamptz' },
 
 { oid => '1367', descr => 'character length',
@@ -3545,13 +3621,16 @@
 # OIDS 1600 - 1699
 
 { oid => '1600', descr => 'arcsine',
-  proname => 'asin', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'asin', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dasin' },
 { oid => '1601', descr => 'arccosine',
-  proname => 'acos', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'acos', prosupport => 'arg0_desc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dacos' },
 { oid => '1602', descr => 'arctangent',
-  proname => 'atan', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'atan', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'datan' },
 { oid => '1603', descr => 'arctangent, two arguments',
   proname => 'atan2', prorettype => 'float8', proargtypes => 'float8 float8',
@@ -3570,13 +3649,16 @@
   prosrc => 'dcot' },
 
 { oid => '2731', descr => 'arcsine, degrees',
-  proname => 'asind', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'asind', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dasind' },
 { oid => '2732', descr => 'arccosine, degrees',
-  proname => 'acosd', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'acosd', prosupport => 'arg0_desc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dacosd' },
 { oid => '2733', descr => 'arctangent, degrees',
-  proname => 'atand', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'atand', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'datand' },
 { oid => '2734', descr => 'arctangent, two arguments, degrees',
   proname => 'atan2d', prorettype => 'float8', proargtypes => 'float8 float8',
@@ -3595,38 +3677,47 @@
   prosrc => 'dcotd' },
 
 { oid => '1608', descr => 'radians to degrees',
-  proname => 'degrees', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'degrees', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'degrees' },
 { oid => '1609', descr => 'degrees to radians',
-  proname => 'radians', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'radians', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'radians' },
 { oid => '1610', descr => 'PI',
   proname => 'pi', prorettype => 'float8', proargtypes => '', prosrc => 'dpi' },
 
 { oid => '2462', descr => 'hyperbolic sine',
-  proname => 'sinh', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'sinh', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dsinh' },
 { oid => '2463', descr => 'hyperbolic cosine',
   proname => 'cosh', prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dcosh' },
 { oid => '2464', descr => 'hyperbolic tangent',
-  proname => 'tanh', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'tanh', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dtanh' },
 { oid => '2465', descr => 'inverse hyperbolic sine',
-  proname => 'asinh', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'asinh', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dasinh' },
 { oid => '2466', descr => 'inverse hyperbolic cosine',
-  proname => 'acosh', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'acosh', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'dacosh' },
 { oid => '2467', descr => 'inverse hyperbolic tangent',
-  proname => 'atanh', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'atanh', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'datanh' },
 
 { oid => '6219', descr => 'error function',
-  proname => 'erf', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'erf', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'derf' },
 { oid => '6220', descr => 'complementary error function',
-  proname => 'erfc', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'erfc', prosupport => 'arg0_desc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'derfc' },
 
 { oid => '6383', descr => 'gamma function',
@@ -3638,7 +3729,8 @@
   prosrc => 'dlgamma' },
 
 { oid => '1618',
-  proname => 'interval_mul', prorettype => 'interval',
+  proname => 'interval_mul',
+  prorettype => 'interval',
   proargtypes => 'interval float8', prosrc => 'interval_mul' },
 
 { oid => '1620', descr => 'convert first char to int4',
@@ -3662,7 +3754,8 @@
   prosrc => 'similar_to_escape_1' },
 
 { oid => '1624',
-  proname => 'mul_d_interval', prorettype => 'interval',
+  proname => 'mul_d_interval',
+  prorettype => 'interval',
   proargtypes => 'float8 interval', prosrc => 'mul_d_interval' },
 
 { oid => '1631',
@@ -4472,16 +4565,20 @@
   proname => 'inetor', prorettype => 'inet', proargtypes => 'inet inet',
   prosrc => 'inetor' },
 { oid => '2630',
-  proname => 'inetpl', prorettype => 'inet', proargtypes => 'inet int8',
+  proname => 'inetpl', prosupport => 'addition_slope_support',
+  prorettype => 'inet', proargtypes => 'inet int8',
   prosrc => 'inetpl' },
 { oid => '2631',
-  proname => 'int8pl_inet', prolang => 'sql', prorettype => 'inet',
+  proname => 'int8pl_inet', prosupport => 'addition_slope_support',
+  prolang => 'sql', prorettype => 'inet',
   proargtypes => 'int8 inet', prosrc => 'see system_functions.sql' },
 { oid => '2632',
-  proname => 'inetmi_int8', prorettype => 'inet', proargtypes => 'inet int8',
+  proname => 'inetmi_int8', prosupport => 'diff_slope_support',
+  prorettype => 'inet', proargtypes => 'inet int8',
   prosrc => 'inetmi_int8' },
 { oid => '2633',
-  proname => 'inetmi', prorettype => 'int8', proargtypes => 'inet inet',
+  proname => 'inetmi', prosupport => 'diff_slope_support',
+  prorettype => 'int8', proargtypes => 'inet inet',
   prosrc => 'inetmi' },
 { oid => '4071', descr => 'are the addresses from the same family?',
   proname => 'inet_same_family', prorettype => 'bool',
@@ -4607,26 +4704,31 @@
   proname => 'sign', prorettype => 'numeric', proargtypes => 'numeric',
   prosrc => 'numeric_sign' },
 { oid => '1707', descr => 'value rounded to \'scale\'',
-  proname => 'round', prorettype => 'numeric', proargtypes => 'numeric int4',
+  proname => 'round', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'numeric', proargtypes => 'numeric int4',
   prosrc => 'numeric_round' },
 { oid => '1708', descr => 'value rounded to \'scale\' of zero',
-  proname => 'round', prolang => 'sql', prorettype => 'numeric',
+  proname => 'round', prosupport => 'arg0_asc_slope_support',
+  prolang => 'sql', prorettype => 'numeric',
   proargtypes => 'numeric', prosrc => 'see system_functions.sql' },
 { oid => '1709', descr => 'value truncated to \'scale\'',
-  proname => 'trunc', prorettype => 'numeric', proargtypes => 'numeric int4',
+  proname => 'trunc', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'numeric', proargtypes => 'numeric int4',
   prosrc => 'numeric_trunc' },
 { oid => '1710', descr => 'value truncated to \'scale\' of zero',
-  proname => 'trunc', prolang => 'sql', prorettype => 'numeric',
+  proname => 'trunc', prosupport => 'arg0_asc_slope_support',
+  prolang => 'sql', prorettype => 'numeric',
   proargtypes => 'numeric', prosrc => 'see system_functions.sql' },
 { oid => '1711', descr => 'nearest integer >= value',
-  proname => 'ceil', prorettype => 'numeric', proargtypes => 'numeric',
-  prosrc => 'numeric_ceil' },
+  proname => 'ceil', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'numeric', proargtypes => 'numeric', prosrc => 'numeric_ceil' },
 { oid => '2167', descr => 'nearest integer >= value',
-  proname => 'ceiling', prorettype => 'numeric', proargtypes => 'numeric',
+  proname => 'ceiling', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'numeric', proargtypes => 'numeric',
   prosrc => 'numeric_ceil' },
 { oid => '1712', descr => 'nearest integer <= value',
-  proname => 'floor', prorettype => 'numeric', proargtypes => 'numeric',
-  prosrc => 'numeric_floor' },
+  proname => 'floor', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'numeric', proargtypes => 'numeric', prosrc => 'numeric_floor' },
 { oid => '1718',
   proname => 'numeric_eq', prorettype => 'bool',
   proargtypes => 'numeric numeric', prosrc => 'numeric_eq' },
@@ -4646,16 +4748,20 @@
   proname => 'numeric_le', prorettype => 'bool',
   proargtypes => 'numeric numeric', prosrc => 'numeric_le' },
 { oid => '1724',
-  proname => 'numeric_add', prorettype => 'numeric',
+  proname => 'numeric_add', prosupport => 'addition_slope_support',
+  prorettype => 'numeric',
   proargtypes => 'numeric numeric', prosrc => 'numeric_add' },
 { oid => '1725',
-  proname => 'numeric_sub', prorettype => 'numeric',
+  proname => 'numeric_sub', prosupport => 'diff_slope_support',
+  prorettype => 'numeric',
   proargtypes => 'numeric numeric', prosrc => 'numeric_sub' },
 { oid => '1726',
-  proname => 'numeric_mul', prorettype => 'numeric',
+  proname => 'numeric_mul', prosupport => 'multiply_slope_support',
+  prorettype => 'numeric',
   proargtypes => 'numeric numeric', prosrc => 'numeric_mul' },
 { oid => '1727',
-  proname => 'numeric_div', prorettype => 'numeric',
+  proname => 'numeric_div', prosupport => 'divide_slope_support',
+  prorettype => 'numeric',
   proargtypes => 'numeric numeric', prosrc => 'numeric_div' },
 { oid => '1728', descr => 'modulus',
   proname => 'mod', prorettype => 'numeric', proargtypes => 'numeric numeric',
@@ -4670,22 +4776,28 @@
   proname => 'lcm', prorettype => 'numeric', proargtypes => 'numeric numeric',
   prosrc => 'numeric_lcm' },
 { oid => '1730', descr => 'square root',
-  proname => 'sqrt', prorettype => 'numeric', proargtypes => 'numeric',
+  proname => 'sqrt', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'numeric', proargtypes => 'numeric',
   prosrc => 'numeric_sqrt' },
 { oid => '1731', descr => 'square root',
-  proname => 'numeric_sqrt', prorettype => 'numeric', proargtypes => 'numeric',
+  proname => 'numeric_sqrt', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'numeric', proargtypes => 'numeric',
   prosrc => 'numeric_sqrt' },
 { oid => '1732', descr => 'natural exponential (e^x)',
-  proname => 'exp', prorettype => 'numeric', proargtypes => 'numeric',
+  proname => 'exp', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'numeric', proargtypes => 'numeric',
   prosrc => 'numeric_exp' },
 { oid => '1733', descr => 'natural exponential (e^x)',
-  proname => 'numeric_exp', prorettype => 'numeric', proargtypes => 'numeric',
+  proname => 'numeric_exp', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'numeric', proargtypes => 'numeric',
   prosrc => 'numeric_exp' },
 { oid => '1734', descr => 'natural logarithm',
-  proname => 'ln', prorettype => 'numeric', proargtypes => 'numeric',
+  proname => 'ln', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'numeric', proargtypes => 'numeric',
   prosrc => 'numeric_ln' },
 { oid => '1735', descr => 'natural logarithm',
-  proname => 'numeric_ln', prorettype => 'numeric', proargtypes => 'numeric',
+  proname => 'numeric_ln', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'numeric', proargtypes => 'numeric',
   prosrc => 'numeric_ln' },
 { oid => '1736', descr => 'logarithm base m of n',
   proname => 'log', prorettype => 'numeric', proargtypes => 'numeric numeric',
@@ -4776,7 +4888,8 @@
   proname => 'numeric_sortsupport', prorettype => 'void',
   proargtypes => 'internal', prosrc => 'numeric_sortsupport' },
 { oid => '1771',
-  proname => 'numeric_uminus', prorettype => 'numeric',
+  proname => 'numeric_uminus', prosupport => 'arg0_desc_slope_support',
+  prorettype => 'numeric',
   proargtypes => 'numeric', prosrc => 'numeric_uminus' },
 { oid => '1779', descr => 'convert numeric to int8',
   proname => 'int8', prorettype => 'int8', proargtypes => 'numeric',
@@ -5347,22 +5460,28 @@
   prosrc => 'int8shr' },
 
 { oid => '1910',
-  proname => 'int8up', prorettype => 'int8', proargtypes => 'int8',
+  proname => 'int8up', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'int8', proargtypes => 'int8',
   prosrc => 'int8up' },
 { oid => '1911',
-  proname => 'int2up', prorettype => 'int2', proargtypes => 'int2',
+  proname => 'int2up', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'int2', proargtypes => 'int2',
   prosrc => 'int2up' },
 { oid => '1912',
-  proname => 'int4up', prorettype => 'int4', proargtypes => 'int4',
+  proname => 'int4up', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'int4', proargtypes => 'int4',
   prosrc => 'int4up' },
 { oid => '1913',
-  proname => 'float4up', prorettype => 'float4', proargtypes => 'float4',
+  proname => 'float4up', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float4', proargtypes => 'float4',
   prosrc => 'float4up' },
 { oid => '1914',
-  proname => 'float8up', prorettype => 'float8', proargtypes => 'float8',
+  proname => 'float8up', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'float8', proargtypes => 'float8',
   prosrc => 'float8up' },
 { oid => '1915',
-  proname => 'numeric_uplus', prorettype => 'numeric', proargtypes => 'numeric',
+  proname => 'numeric_uplus', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'numeric', proargtypes => 'numeric',
   prosrc => 'numeric_uplus' },
 
 { oid => '1922', descr => 'user privilege on relation by username, rel name',
@@ -6396,8 +6515,8 @@
   proname => 'time', provolatile => 's', prorettype => 'time',
   proargtypes => 'timestamptz', prosrc => 'timestamptz_time' },
 { oid => '2020', descr => 'truncate timestamp to specified units',
-  proname => 'date_trunc', prorettype => 'timestamp',
-  proargtypes => 'text timestamp', prosrc => 'timestamp_trunc' },
+  proname => 'date_trunc', prosupport => 'arg1_asc_slope_support',
+  prorettype => 'timestamp', proargtypes => 'text timestamp', prosrc => 'timestamp_trunc' },
 
 { oid => '6177', descr => 'bin timestamp into specified interval',
   proname => 'date_bin', prorettype => 'timestamp',
@@ -6415,10 +6534,12 @@
   proname => 'extract', prorettype => 'numeric',
   proargtypes => 'text timestamp', prosrc => 'extract_timestamp' },
 { oid => '2024', descr => 'convert date to timestamp',
-  proname => 'timestamp', prorettype => 'timestamp', proargtypes => 'date',
+  proname => 'timestamp', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'timestamp', proargtypes => 'date',
   prosrc => 'date_timestamp' },
 { oid => '2025', descr => 'convert date and time to timestamp',
-  proname => 'timestamp', prorettype => 'timestamp', proargtypes => 'date time',
+  proname => 'timestamp', prosupport => 'addition_slope_support',
+  prorettype => 'timestamp', proargtypes => 'date time',
   prosrc => 'datetime_timestamp' },
 { oid => '2027', descr => 'convert timestamp with time zone to timestamp',
   proname => 'timestamp', provolatile => 's', prorettype => 'timestamp',
@@ -6427,16 +6548,20 @@
   proname => 'timestamptz', provolatile => 's', prorettype => 'timestamptz',
   proargtypes => 'timestamp', prosrc => 'timestamp_timestamptz' },
 { oid => '2029', descr => 'convert timestamp to date',
-  proname => 'date', prorettype => 'date', proargtypes => 'timestamp',
+  proname => 'date', prosupport => 'arg0_asc_slope_support',
+  prorettype => 'date', proargtypes => 'timestamp',
   prosrc => 'timestamp_date' },
 { oid => '2031',
-  proname => 'timestamp_mi', prorettype => 'interval',
+  proname => 'timestamp_mi', prosupport => 'diff_slope_support',
+  prorettype => 'interval',
   proargtypes => 'timestamp timestamp', prosrc => 'timestamp_mi' },
 { oid => '2032',
-  proname => 'timestamp_pl_interval', prorettype => 'timestamp',
+  proname => 'timestamp_pl_interval',
+  prorettype => 'timestamp',
   proargtypes => 'timestamp interval', prosrc => 'timestamp_pl_interval' },
 { oid => '2033',
-  proname => 'timestamp_mi_interval', prorettype => 'timestamp',
+  proname => 'timestamp_mi_interval',
+  prorettype => 'timestamp',
   proargtypes => 'timestamp interval', prosrc => 'timestamp_mi_interval' },
 { oid => '2035', descr => 'smaller of two',
   proname => 'timestamp_smaller', prorettype => 'timestamp',
@@ -6561,10 +6686,12 @@
   proname => 'timezone', provolatile => 's', prorettype => 'timestamptz',
   proargtypes => 'timestamp', prosrc => 'timestamp_at_local' },
 { oid => '2071',
-  proname => 'date_pl_interval', prorettype => 'timestamp',
+  proname => 'date_pl_interval',
+  prorettype => 'timestamp',
   proargtypes => 'date interval', prosrc => 'date_pl_interval' },
 { oid => '2072',
-  proname => 'date_mi_interval', prorettype => 'timestamp',
+  proname => 'date_mi_interval',
+  prorettype => 'timestamp',
   proargtypes => 'date interval', prosrc => 'date_mi_interval' },
 
 { oid => '2073', descr => 'extract text matching regular expression',
@@ -8869,21 +8996,25 @@
 
 # formerly-missing interval + datetime operators
 { oid => '2546',
-  proname => 'interval_pl_date', prolang => 'sql', prorettype => 'timestamp',
+  proname => 'interval_pl_date',
+  prolang => 'sql', prorettype => 'timestamp',
   proargtypes => 'interval date', prosrc => 'see system_functions.sql' },
 { oid => '2547',
   proname => 'interval_pl_timetz', prolang => 'sql', prorettype => 'timetz',
   proargtypes => 'interval timetz', prosrc => 'see system_functions.sql' },
 { oid => '2548',
-  proname => 'interval_pl_timestamp', prolang => 'sql',
+  proname => 'interval_pl_timestamp',
+  prolang => 'sql',
   prorettype => 'timestamp', proargtypes => 'interval timestamp',
   prosrc => 'see system_functions.sql' },
 { oid => '2549',
-  proname => 'interval_pl_timestamptz', prolang => 'sql', provolatile => 's',
+  proname => 'interval_pl_timestamptz',
+  prolang => 'sql', provolatile => 's',
   prorettype => 'timestamptz', proargtypes => 'interval timestamptz',
   prosrc => 'see system_functions.sql' },
 { oid => '2550',
-  proname => 'integer_pl_date', prolang => 'sql', prorettype => 'date',
+  proname => 'integer_pl_date', prosupport => 'addition_slope_support',
+  prolang => 'sql', prorettype => 'date',
   proargtypes => 'int4 date', prosrc => 'see system_functions.sql' },
 
 { oid => '2556', descr => 'get OIDs of databases in a tablespace',
@@ -9706,7 +9837,8 @@
   proname => 'pg_lsn_ne', proleakproof => 't', prorettype => 'bool',
   proargtypes => 'pg_lsn pg_lsn', prosrc => 'pg_lsn_ne' },
 { oid => '3237',
-  proname => 'pg_lsn_mi', prorettype => 'numeric',
+  proname => 'pg_lsn_mi', prosupport => 'diff_slope_support',
+  prorettype => 'numeric',
   proargtypes => 'pg_lsn pg_lsn', prosrc => 'pg_lsn_mi' },
 { oid => '3238', descr => 'I/O',
   proname => 'pg_lsn_recv', prorettype => 'pg_lsn', proargtypes => 'internal',
@@ -9730,13 +9862,16 @@
   proname => 'pg_lsn_smaller', prorettype => 'pg_lsn',
   proargtypes => 'pg_lsn pg_lsn', prosrc => 'pg_lsn_smaller' },
 { oid => '5022',
-  proname => 'pg_lsn_pli', prorettype => 'pg_lsn',
+  proname => 'pg_lsn_pli', prosupport => 'addition_slope_support',
+  prorettype => 'pg_lsn',
   proargtypes => 'pg_lsn numeric', prosrc => 'pg_lsn_pli' },
 { oid => '5023',
-  proname => 'numeric_pl_pg_lsn', prolang => 'sql', prorettype => 'pg_lsn',
+  proname => 'numeric_pl_pg_lsn', prosupport => 'addition_slope_support',
+  prolang => 'sql', prorettype => 'pg_lsn',
   proargtypes => 'numeric pg_lsn', prosrc => 'see system_functions.sql' },
 { oid => '5024',
-  proname => 'pg_lsn_mii', prorettype => 'pg_lsn',
+  proname => 'pg_lsn_mii', prosupport => 'diff_slope_support',
+  prorettype => 'pg_lsn',
   proargtypes => 'pg_lsn numeric', prosrc => 'pg_lsn_mii' },
 
 # enum related procs
@@ -12650,6 +12785,29 @@
   proargnames => '{schemaname,relname,statistics_schemaname,statistics_name,inherited}',
   prosrc => 'pg_clear_extended_stats' },
 
+# monotonic support functions for scalar function ordering optimization (SLOPE)
+{ oid => '9954', descr => 'planner support for ascending slope in arg 0',
+  proname => 'arg0_asc_slope_support', prorettype => 'internal',
+  proargtypes => 'internal', prosrc => 'arg0_asc_slope_support' },
+{ oid => '9955', descr => 'planner support for descending slope in arg 0',
+  proname => 'arg0_desc_slope_support', prorettype => 'internal',
+  proargtypes => 'internal', prosrc => 'arg0_desc_slope_support' },
+{ oid => '9956', descr => 'planner support for ascending slope in arg 1',
+  proname => 'arg1_asc_slope_support', prorettype => 'internal',
+  proargtypes => 'internal', prosrc => 'arg1_asc_slope_support' },
+{ oid => '9957', descr => 'planner support for diff slope (asc arg0, desc arg1)',
+  proname => 'diff_slope_support', prorettype => 'internal',
+  proargtypes => 'internal', prosrc => 'diff_slope_support' },
+{ oid => '9958', descr => 'planner support for addition slope (asc both args)',
+  proname => 'addition_slope_support', prorettype => 'internal',
+  proargtypes => 'internal', prosrc => 'addition_slope_support' },
+{ oid => '9959', descr => 'planner support for multiply slope (sign-dependent)',
+  proname => 'multiply_slope_support', prorettype => 'internal',
+  proargtypes => 'internal', prosrc => 'multiply_slope_support' },
+{ oid => '9960', descr => 'planner support for divide slope (sign-dependent)',
+  proname => 'divide_slope_support', prorettype => 'internal',
+  proargtypes => 'internal', prosrc => 'divide_slope_support' },
+
 # AIO related functions
 { oid => '6399', descr => 'information about in-progress asynchronous IOs',
   proname => 'pg_get_aios', prorows => '100', proretset => 't',
diff --git a/src/include/nodes/supportnodes.h b/src/include/nodes/supportnodes.h
index 132a2bcd8af..106a369e1cc 100644
--- a/src/include/nodes/supportnodes.h
+++ b/src/include/nodes/supportnodes.h
@@ -445,4 +445,29 @@ typedef struct SupportRequestModifyInPlace
 	int			paramid;		/* ID of Param(s) representing variable */
 } SupportRequestModifyInPlace;
 
+/* ----------
+ * SupportRequestMonotonic: request monotonicity information for SLOPE
+ *
+ * This allows the planner to use an index on 'x' to satisfy ORDER BY f(x)
+ * when f is monotonic.  The support function fills in the slopes array
+ * to indicate the monotonicity of each argument.
+ *
+ *	'expr' is the FuncExpr or OpExpr being analyzed.
+ *	'nslopes' points to a MonotonicFunction array (one per argument up to
+ *	nslopes).  Arguments beyond nslopes are treated as MONOTONICFUNC_NONE.
+ *	Return the request pointer on success, or NULL if not monotonic.
+ * ----------
+ */
+typedef struct SupportRequestMonotonic
+{
+	NodeTag		type;
+
+	/* Input fields: */
+	Node	   *expr;			/* FuncExpr or OpExpr */
+
+	/* Output fields (set by prosupport function): */
+	int			nslopes;		/* number of slopes in array */
+	const MonotonicFunction *slopes;	/* array of slopes, one per arg */
+} SupportRequestMonotonic;
+
 #endif							/* SUPPORTNODES_H */
diff --git a/src/test/regress/expected/slope_catalog.out b/src/test/regress/expected/slope_catalog.out
new file mode 100644
index 00000000000..45659911e55
--- /dev/null
+++ b/src/test/regress/expected/slope_catalog.out
@@ -0,0 +1,296 @@
+--
+-- SLOPE catalog: verify prosupport assignments for monotonic functions
+--
+-- Operators with slope prosupport
+SELECT
+    o.oid AS "oid",
+    o.oprname AS operator,
+    format_type(o.oprleft, NULL) COLLATE "C" AS left_type,
+    format_type(o.oprright, NULL) COLLATE "C" AS right_type,
+    sp.proname AS prosupport
+FROM pg_operator o
+JOIN pg_proc p ON p.oid = o.oprcode
+JOIN pg_proc sp ON sp.oid = p.prosupport
+WHERE sp.proname LIKE '%slope%'
+ORDER BY sp.proname, o.oprname, left_type, right_type;
+ oid  | operator |          left_type          |         right_type          |       prosupport        
+------+----------+-----------------------------+-----------------------------+-------------------------
+  684 | +        | bigint                      | bigint                      | addition_slope_support
+ 2638 | +        | bigint                      | inet                        | addition_slope_support
+  688 | +        | bigint                      | integer                     | addition_slope_support
+  818 | +        | bigint                      | smallint                    | addition_slope_support
+ 1100 | +        | date                        | integer                     | addition_slope_support
+ 1360 | +        | date                        | time without time zone      | addition_slope_support
+  591 | +        | double precision            | double precision            | addition_slope_support
+ 1126 | +        | double precision            | real                        | addition_slope_support
+ 2637 | +        | inet                        | bigint                      | addition_slope_support
+  692 | +        | integer                     | bigint                      | addition_slope_support
+ 2555 | +        | integer                     | date                        | addition_slope_support
+  551 | +        | integer                     | integer                     | addition_slope_support
+  553 | +        | integer                     | smallint                    | addition_slope_support
+  906 | +        | money                       | money                       | addition_slope_support
+ 1758 | +        | numeric                     | numeric                     | addition_slope_support
+ 5026 | +        | numeric                     | pg_lsn                      | addition_slope_support
+ 5025 | +        | pg_lsn                      | numeric                     | addition_slope_support
+ 1116 | +        | real                        | double precision            | addition_slope_support
+  586 | +        | real                        | real                        | addition_slope_support
+  822 | +        | smallint                    | bigint                      | addition_slope_support
+  552 | +        | smallint                    | integer                     | addition_slope_support
+  550 | +        | smallint                    | smallint                    | addition_slope_support
+ 1916 | +        | -                           | bigint                      | arg0_asc_slope_support
+ 1920 | +        | -                           | double precision            | arg0_asc_slope_support
+ 1918 | +        | -                           | integer                     | arg0_asc_slope_support
+ 1921 | +        | -                           | numeric                     | arg0_asc_slope_support
+ 1919 | +        | -                           | real                        | arg0_asc_slope_support
+ 1917 | +        | -                           | smallint                    | arg0_asc_slope_support
+ 1361 | +        | date                        | time with time zone         | arg0_asc_slope_support
+  484 | -        | -                           | bigint                      | arg0_desc_slope_support
+  585 | -        | -                           | double precision            | arg0_desc_slope_support
+  558 | -        | -                           | integer                     | arg0_desc_slope_support
+ 1751 | -        | -                           | numeric                     | arg0_desc_slope_support
+  584 | -        | -                           | real                        | arg0_desc_slope_support
+  559 | -        | -                           | smallint                    | arg0_desc_slope_support
+ 1366 | +        | time with time zone         | date                        | arg1_asc_slope_support
+ 1363 | +        | time without time zone      | date                        | arg1_asc_slope_support
+  685 | -        | bigint                      | bigint                      | diff_slope_support
+  689 | -        | bigint                      | integer                     | diff_slope_support
+  819 | -        | bigint                      | smallint                    | diff_slope_support
+ 1099 | -        | date                        | date                        | diff_slope_support
+ 1101 | -        | date                        | integer                     | diff_slope_support
+  592 | -        | double precision            | double precision            | diff_slope_support
+ 1127 | -        | double precision            | real                        | diff_slope_support
+ 2639 | -        | inet                        | bigint                      | diff_slope_support
+ 2640 | -        | inet                        | inet                        | diff_slope_support
+  693 | -        | integer                     | bigint                      | diff_slope_support
+  555 | -        | integer                     | integer                     | diff_slope_support
+  557 | -        | integer                     | smallint                    | diff_slope_support
+  907 | -        | money                       | money                       | diff_slope_support
+ 1759 | -        | numeric                     | numeric                     | diff_slope_support
+ 5027 | -        | pg_lsn                      | numeric                     | diff_slope_support
+ 3228 | -        | pg_lsn                      | pg_lsn                      | diff_slope_support
+ 1117 | -        | real                        | double precision            | diff_slope_support
+  587 | -        | real                        | real                        | diff_slope_support
+  823 | -        | smallint                    | bigint                      | diff_slope_support
+  556 | -        | smallint                    | integer                     | diff_slope_support
+  554 | -        | smallint                    | smallint                    | diff_slope_support
+ 1328 | -        | timestamp with time zone    | timestamp with time zone    | diff_slope_support
+ 2067 | -        | timestamp without time zone | timestamp without time zone | diff_slope_support
+  687 | /        | bigint                      | bigint                      | divide_slope_support
+  691 | /        | bigint                      | integer                     | divide_slope_support
+  821 | /        | bigint                      | smallint                    | divide_slope_support
+  593 | /        | double precision            | double precision            | divide_slope_support
+ 1128 | /        | double precision            | real                        | divide_slope_support
+  695 | /        | integer                     | bigint                      | divide_slope_support
+  528 | /        | integer                     | integer                     | divide_slope_support
+  547 | /        | integer                     | smallint                    | divide_slope_support
+ 3347 | /        | money                       | bigint                      | divide_slope_support
+  909 | /        | money                       | double precision            | divide_slope_support
+  913 | /        | money                       | integer                     | divide_slope_support
+ 3825 | /        | money                       | money                       | divide_slope_support
+  844 | /        | money                       | real                        | divide_slope_support
+  915 | /        | money                       | smallint                    | divide_slope_support
+ 1761 | /        | numeric                     | numeric                     | divide_slope_support
+ 1118 | /        | real                        | double precision            | divide_slope_support
+  588 | /        | real                        | real                        | divide_slope_support
+  825 | /        | smallint                    | bigint                      | divide_slope_support
+  546 | /        | smallint                    | integer                     | divide_slope_support
+  527 | /        | smallint                    | smallint                    | divide_slope_support
+  686 | *        | bigint                      | bigint                      | multiply_slope_support
+  690 | *        | bigint                      | integer                     | multiply_slope_support
+ 3349 | *        | bigint                      | money                       | multiply_slope_support
+  820 | *        | bigint                      | smallint                    | multiply_slope_support
+  594 | *        | double precision            | double precision            | multiply_slope_support
+  916 | *        | double precision            | money                       | multiply_slope_support
+ 1129 | *        | double precision            | real                        | multiply_slope_support
+  694 | *        | integer                     | bigint                      | multiply_slope_support
+  514 | *        | integer                     | integer                     | multiply_slope_support
+  917 | *        | integer                     | money                       | multiply_slope_support
+  545 | *        | integer                     | smallint                    | multiply_slope_support
+ 3346 | *        | money                       | bigint                      | multiply_slope_support
+  908 | *        | money                       | double precision            | multiply_slope_support
+  912 | *        | money                       | integer                     | multiply_slope_support
+  843 | *        | money                       | real                        | multiply_slope_support
+  914 | *        | money                       | smallint                    | multiply_slope_support
+ 1760 | *        | numeric                     | numeric                     | multiply_slope_support
+ 1119 | *        | real                        | double precision            | multiply_slope_support
+  845 | *        | real                        | money                       | multiply_slope_support
+  589 | *        | real                        | real                        | multiply_slope_support
+  824 | *        | smallint                    | bigint                      | multiply_slope_support
+  544 | *        | smallint                    | integer                     | multiply_slope_support
+  918 | *        | smallint                    | money                       | multiply_slope_support
+  526 | *        | smallint                    | smallint                    | multiply_slope_support
+(104 rows)
+
+-- Functions (non-operator) with slope prosupport
+SELECT
+    p.oid AS "oid",
+    p.proname AS "function",
+    pg_get_function_arguments(p.oid) COLLATE "C" AS arguments,
+    format_type(p.prorettype, NULL) AS returns,
+    sp.proname AS prosupport
+FROM pg_proc p
+JOIN pg_proc sp ON sp.oid = p.prosupport
+WHERE sp.proname LIKE '%slope%'
+  AND NOT EXISTS (SELECT 1 FROM pg_operator o WHERE o.oprcode = p.oid)
+ORDER BY sp.proname, p.proname, arguments;
+ oid  |   function   |              arguments               |           returns           |       prosupport        
+------+--------------+--------------------------------------+-----------------------------+-------------------------
+ 2025 | timestamp    | date, time without time zone         | timestamp without time zone | addition_slope_support
+ 2466 | acosh        | double precision                     | double precision            | arg0_asc_slope_support
+ 1600 | asin         | double precision                     | double precision            | arg0_asc_slope_support
+ 2731 | asind        | double precision                     | double precision            | arg0_asc_slope_support
+ 2465 | asinh        | double precision                     | double precision            | arg0_asc_slope_support
+ 1602 | atan         | double precision                     | double precision            | arg0_asc_slope_support
+ 2733 | atand        | double precision                     | double precision            | arg0_asc_slope_support
+ 2467 | atanh        | double precision                     | double precision            | arg0_asc_slope_support
+ 1345 | cbrt         | double precision                     | double precision            | arg0_asc_slope_support
+ 2308 | ceil         | double precision                     | double precision            | arg0_asc_slope_support
+ 1711 | ceil         | numeric                              | numeric                     | arg0_asc_slope_support
+ 2320 | ceiling      | double precision                     | double precision            | arg0_asc_slope_support
+ 2167 | ceiling      | numeric                              | numeric                     | arg0_asc_slope_support
+ 1178 | date         | timestamp with time zone             | date                        | arg0_asc_slope_support
+ 2029 | date         | timestamp without time zone          | date                        | arg0_asc_slope_support
+ 1608 | degrees      | double precision                     | double precision            | arg0_asc_slope_support
+ 6219 | erf          | double precision                     | double precision            | arg0_asc_slope_support
+ 1347 | exp          | double precision                     | double precision            | arg0_asc_slope_support
+ 1732 | exp          | numeric                              | numeric                     | arg0_asc_slope_support
+ 2309 | floor        | double precision                     | double precision            | arg0_asc_slope_support
+ 1712 | floor        | numeric                              | numeric                     | arg0_asc_slope_support
+ 1341 | ln           | double precision                     | double precision            | arg0_asc_slope_support
+ 1734 | ln           | numeric                              | numeric                     | arg0_asc_slope_support
+ 1340 | log          | double precision                     | double precision            | arg0_asc_slope_support
+ 1741 | log          | numeric                              | numeric                     | arg0_asc_slope_support
+ 1194 | log10        | double precision                     | double precision            | arg0_asc_slope_support
+ 1481 | log10        | numeric                              | numeric                     | arg0_asc_slope_support
+ 1733 | numeric_exp  | numeric                              | numeric                     | arg0_asc_slope_support
+ 1735 | numeric_ln   | numeric                              | numeric                     | arg0_asc_slope_support
+ 1731 | numeric_sqrt | numeric                              | numeric                     | arg0_asc_slope_support
+ 1609 | radians      | double precision                     | double precision            | arg0_asc_slope_support
+ 1342 | round        | double precision                     | double precision            | arg0_asc_slope_support
+ 1708 | round        | numeric                              | numeric                     | arg0_asc_slope_support
+ 1707 | round        | numeric, integer                     | numeric                     | arg0_asc_slope_support
+ 2462 | sinh         | double precision                     | double precision            | arg0_asc_slope_support
+ 1344 | sqrt         | double precision                     | double precision            | arg0_asc_slope_support
+ 1730 | sqrt         | numeric                              | numeric                     | arg0_asc_slope_support
+ 2464 | tanh         | double precision                     | double precision            | arg0_asc_slope_support
+ 2024 | timestamp    | date                                 | timestamp without time zone | arg0_asc_slope_support
+ 1174 | timestamptz  | date                                 | timestamp with time zone    | arg0_asc_slope_support
+ 1359 | timestamptz  | date, time with time zone            | timestamp with time zone    | arg0_asc_slope_support
+ 1176 | timestamptz  | date, time without time zone         | timestamp with time zone    | arg0_asc_slope_support
+ 1158 | to_timestamp | double precision                     | timestamp with time zone    | arg0_asc_slope_support
+ 1343 | trunc        | double precision                     | double precision            | arg0_asc_slope_support
+ 1710 | trunc        | numeric                              | numeric                     | arg0_asc_slope_support
+ 1709 | trunc        | numeric, integer                     | numeric                     | arg0_asc_slope_support
+ 1601 | acos         | double precision                     | double precision            | arg0_desc_slope_support
+ 2732 | acosd        | double precision                     | double precision            | arg0_desc_slope_support
+ 6220 | erfc         | double precision                     | double precision            | arg0_desc_slope_support
+ 1217 | date_trunc   | text, timestamp with time zone       | timestamp with time zone    | arg1_asc_slope_support
+ 1284 | date_trunc   | text, timestamp with time zone, text | timestamp with time zone    | arg1_asc_slope_support
+ 2020 | date_trunc   | text, timestamp without time zone    | timestamp without time zone | arg1_asc_slope_support
+(52 rows)
+
+-- Operators whose name has slope support for some types but not others
+SELECT
+    u.oid AS "oid",
+    u.oprname AS operator,
+    format_type(u.oprleft, NULL) COLLATE "C" AS left_type,
+    format_type(u.oprright, NULL) COLLATE "C" AS right_type
+FROM pg_operator u
+JOIN pg_proc up ON up.oid = u.oprcode
+WHERE (up.prosupport = 0 OR NOT EXISTS (
+        SELECT 1 FROM pg_proc sp
+        WHERE sp.oid = up.prosupport AND sp.proname LIKE '%slope%'))
+  AND EXISTS (
+      SELECT 1
+      FROM pg_operator s
+      JOIN pg_proc sp_impl ON sp_impl.oid = s.oprcode
+      JOIN pg_proc sp_sup ON sp_sup.oid = sp_impl.prosupport
+      WHERE s.oprname = u.oprname
+        AND sp_sup.proname LIKE '%slope%')
+ORDER BY u.oprname, left_type, right_type;
+ oid  | operator |          left_type          |         right_type          
+------+----------+-----------------------------+-----------------------------
+ 4394 | *        | anymultirange               | anymultirange
+ 3900 | *        | anyrange                    | anyrange
+  806 | *        | box                         | point
+ 1518 | *        | circle                      | point
+ 1584 | *        | double precision            | interval
+ 1583 | *        | interval                    | double precision
+  738 | *        | path                        | point
+  733 | *        | point                       | point
+  966 | +        | aclitem[]                   | aclitem
+ 4392 | +        | anymultirange               | anymultirange
+ 3898 | +        | anyrange                    | anyrange
+  804 | +        | box                         | point
+ 1516 | +        | circle                      | point
+ 1076 | +        | date                        | interval
+ 2551 | +        | interval                    | date
+ 1337 | +        | interval                    | interval
+ 2552 | +        | interval                    | time with time zone
+ 1849 | +        | interval                    | time without time zone
+ 2554 | +        | interval                    | timestamp with time zone
+ 2553 | +        | interval                    | timestamp without time zone
+  735 | +        | path                        | path
+  736 | +        | path                        | point
+  731 | +        | point                       | point
+ 1802 | +        | time with time zone         | interval
+ 1800 | +        | time without time zone      | interval
+ 1327 | +        | timestamp with time zone    | interval
+ 2066 | +        | timestamp without time zone | interval
+ 1336 | -        | -                           | interval
+  967 | -        | aclitem[]                   | aclitem
+ 4393 | -        | anymultirange               | anymultirange
+ 3899 | -        | anyrange                    | anyrange
+  805 | -        | box                         | point
+ 1517 | -        | circle                      | point
+ 1077 | -        | date                        | interval
+ 1338 | -        | interval                    | interval
+ 3286 | -        | jsonb                       | integer
+ 3285 | -        | jsonb                       | text
+ 3398 | -        | jsonb                       | text[]
+  737 | -        | path                        | point
+  732 | -        | point                       | point
+ 1803 | -        | time with time zone         | interval
+ 1801 | -        | time without time zone      | interval
+ 1399 | -        | time without time zone      | time without time zone
+ 1329 | -        | timestamp with time zone    | interval
+ 2068 | -        | timestamp without time zone | interval
+  807 | /        | box                         | point
+ 1519 | /        | circle                      | point
+ 1585 | /        | interval                    | double precision
+  739 | /        | path                        | point
+  734 | /        | point                       | point
+(50 rows)
+
+-- Functions whose name has slope support for some signatures but not others
+SELECT
+    u.oid AS "oid",
+    u.proname AS "function",
+    pg_get_function_arguments(u.oid) COLLATE "C" AS arguments,
+    format_type(u.prorettype, NULL) AS returns
+FROM pg_proc u
+WHERE (u.prosupport = 0 OR NOT EXISTS (
+        SELECT 1 FROM pg_proc sp
+        WHERE sp.oid = u.prosupport AND sp.proname LIKE '%slope%'))
+  AND NOT EXISTS (SELECT 1 FROM pg_operator o WHERE o.oprcode = u.oid)
+  AND EXISTS (
+      SELECT 1
+      FROM pg_proc s
+      JOIN pg_proc sp ON sp.oid = s.prosupport
+      WHERE s.proname = u.proname
+        AND sp.proname LIKE '%slope%'
+        AND NOT EXISTS (SELECT 1 FROM pg_operator o WHERE o.oprcode = s.oid))
+ORDER BY u.proname, arguments;
+ oid  |   function   |              arguments               |           returns           
+------+--------------+--------------------------------------+-----------------------------
+ 1218 | date_trunc   | text, interval                       | interval
+ 1736 | log          | numeric, numeric                     | numeric
+ 2027 | timestamp    | timestamp with time zone             | timestamp without time zone
+ 1961 | timestamp    | timestamp without time zone, integer | timestamp without time zone
+ 1967 | timestamptz  | timestamp with time zone, integer    | timestamp with time zone
+ 2028 | timestamptz  | timestamp without time zone          | timestamp with time zone
+ 1778 | to_timestamp | text, text                           | timestamp with time zone
+  753 | trunc        | macaddr                              | macaddr
+ 4112 | trunc        | macaddr8                             | macaddr8
+(9 rows)
+
diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule
index 8fa0a6c47fb..742f5d2bbf4 100644
--- a/src/test/regress/parallel_schedule
+++ b/src/test/regress/parallel_schedule
@@ -133,7 +133,7 @@ test: compression compression_lz4 compression_pglz cluster
 # event_trigger depends on create_am and cannot run concurrently with
 # any test that runs DDL
 # oidjoins is read-only, though, and should run late for best coverage
-test: oidjoins event_trigger
+test: oidjoins event_trigger slope_catalog
 
 
 # event_trigger_login cannot run concurrently with any other tests because
diff --git a/src/test/regress/sql/slope_catalog.sql b/src/test/regress/sql/slope_catalog.sql
new file mode 100644
index 00000000000..8256cd232ab
--- /dev/null
+++ b/src/test/regress/sql/slope_catalog.sql
@@ -0,0 +1,69 @@
+--
+-- SLOPE catalog: verify prosupport assignments for monotonic functions
+--
+
+-- Operators with slope prosupport
+SELECT
+    o.oid AS "oid",
+    o.oprname AS operator,
+    format_type(o.oprleft, NULL) COLLATE "C" AS left_type,
+    format_type(o.oprright, NULL) COLLATE "C" AS right_type,
+    sp.proname AS prosupport
+FROM pg_operator o
+JOIN pg_proc p ON p.oid = o.oprcode
+JOIN pg_proc sp ON sp.oid = p.prosupport
+WHERE sp.proname LIKE '%slope%'
+ORDER BY sp.proname, o.oprname, left_type, right_type;
+
+-- Functions (non-operator) with slope prosupport
+SELECT
+    p.oid AS "oid",
+    p.proname AS "function",
+    pg_get_function_arguments(p.oid) COLLATE "C" AS arguments,
+    format_type(p.prorettype, NULL) AS returns,
+    sp.proname AS prosupport
+FROM pg_proc p
+JOIN pg_proc sp ON sp.oid = p.prosupport
+WHERE sp.proname LIKE '%slope%'
+  AND NOT EXISTS (SELECT 1 FROM pg_operator o WHERE o.oprcode = p.oid)
+ORDER BY sp.proname, p.proname, arguments;
+
+-- Operators whose name has slope support for some types but not others
+SELECT
+    u.oid AS "oid",
+    u.oprname AS operator,
+    format_type(u.oprleft, NULL) COLLATE "C" AS left_type,
+    format_type(u.oprright, NULL) COLLATE "C" AS right_type
+FROM pg_operator u
+JOIN pg_proc up ON up.oid = u.oprcode
+WHERE (up.prosupport = 0 OR NOT EXISTS (
+        SELECT 1 FROM pg_proc sp
+        WHERE sp.oid = up.prosupport AND sp.proname LIKE '%slope%'))
+  AND EXISTS (
+      SELECT 1
+      FROM pg_operator s
+      JOIN pg_proc sp_impl ON sp_impl.oid = s.oprcode
+      JOIN pg_proc sp_sup ON sp_sup.oid = sp_impl.prosupport
+      WHERE s.oprname = u.oprname
+        AND sp_sup.proname LIKE '%slope%')
+ORDER BY u.oprname, left_type, right_type;
+
+-- Functions whose name has slope support for some signatures but not others
+SELECT
+    u.oid AS "oid",
+    u.proname AS "function",
+    pg_get_function_arguments(u.oid) COLLATE "C" AS arguments,
+    format_type(u.prorettype, NULL) AS returns
+FROM pg_proc u
+WHERE (u.prosupport = 0 OR NOT EXISTS (
+        SELECT 1 FROM pg_proc sp
+        WHERE sp.oid = u.prosupport AND sp.proname LIKE '%slope%'))
+  AND NOT EXISTS (SELECT 1 FROM pg_operator o WHERE o.oprcode = u.oid)
+  AND EXISTS (
+      SELECT 1
+      FROM pg_proc s
+      JOIN pg_proc sp ON sp.oid = s.prosupport
+      WHERE s.proname = u.proname
+        AND sp.proname LIKE '%slope%'
+        AND NOT EXISTS (SELECT 1 FROM pg_operator o WHERE o.oprcode = s.oid))
+ORDER BY u.proname, arguments;
-- 
2.53.0

