summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2024-07-11 11:50:50 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2024-07-11 11:50:50 -0400
commita0f1fce80c0373c16b22a1bdc9b0b61958fc9b6a (patch)
tree5bd3bf2c2ad8ba6238dc28f1d2bf4b707e3dccb8 /src/include
parentbb19b70081e2248f242cd00227abff5b1e105eb6 (diff)
Add min and max aggregates for composite types (records).
Like min/max for arrays, these are just thin wrappers around the existing btree comparison function for records. Aleksander Alekseev Discussion: https://postgr.es/m/CAO=iB8L4WYSNxCJ8GURRjQsrXEQ2-zn3FiCsh2LMqvWq2WcONg@mail.gmail.com
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/catversion.h2
-rw-r--r--src/include/catalog/pg_aggregate.dat6
-rw-r--r--src/include/catalog/pg_proc.dat14
3 files changed, 20 insertions, 2 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 87b52fffdde..3254e7ab929 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -57,6 +57,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 202407101
+#define CATALOG_VERSION_NO 202407111
#endif
diff --git a/src/include/catalog/pg_aggregate.dat b/src/include/catalog/pg_aggregate.dat
index 5f13532abcc..b6b6352d917 100644
--- a/src/include/catalog/pg_aggregate.dat
+++ b/src/include/catalog/pg_aggregate.dat
@@ -140,6 +140,9 @@
{ aggfnoid => 'max(anyarray)', aggtransfn => 'array_larger',
aggcombinefn => 'array_larger', aggsortop => '>(anyarray,anyarray)',
aggtranstype => 'anyarray' },
+{ aggfnoid => 'max(record)', aggtransfn => 'record_larger',
+ aggcombinefn => 'record_larger', aggsortop => '>(record,record)',
+ aggtranstype => 'record' },
{ aggfnoid => 'max(bpchar)', aggtransfn => 'bpchar_larger',
aggcombinefn => 'bpchar_larger', aggsortop => '>(bpchar,bpchar)',
aggtranstype => 'bpchar' },
@@ -208,6 +211,9 @@
{ aggfnoid => 'min(anyarray)', aggtransfn => 'array_smaller',
aggcombinefn => 'array_smaller', aggsortop => '<(anyarray,anyarray)',
aggtranstype => 'anyarray' },
+{ aggfnoid => 'min(record)', aggtransfn => 'record_smaller',
+ aggcombinefn => 'record_smaller', aggsortop => '<(record,record)',
+ aggtranstype => 'record' },
{ aggfnoid => 'min(bpchar)', aggtransfn => 'bpchar_smaller',
aggcombinefn => 'bpchar_smaller', aggsortop => '<(bpchar,bpchar)',
aggtranstype => 'bpchar' },
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 0d140003e74..73d9cf85826 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -6754,6 +6754,9 @@
proname => 'max', prokind => 'a', proisstrict => 'f',
prorettype => 'anyarray', proargtypes => 'anyarray',
prosrc => 'aggregate_dummy' },
+{ oid => '8595', descr => 'maximum value of all record input values',
+ proname => 'max', prokind => 'a', proisstrict => 'f', prorettype => 'record',
+ proargtypes => 'record', prosrc => 'aggregate_dummy' },
{ oid => '2244', descr => 'maximum value of all bpchar input values',
proname => 'max', prokind => 'a', proisstrict => 'f', prorettype => 'bpchar',
proargtypes => 'bpchar', prosrc => 'aggregate_dummy' },
@@ -6824,6 +6827,9 @@
proname => 'min', prokind => 'a', proisstrict => 'f',
prorettype => 'anyarray', proargtypes => 'anyarray',
prosrc => 'aggregate_dummy' },
+{ oid => '8596', descr => 'minimum value of all record input values',
+ proname => 'min', prokind => 'a', proisstrict => 'f', prorettype => 'record',
+ proargtypes => 'record', prosrc => 'aggregate_dummy' },
{ oid => '2245', descr => 'minimum value of all bpchar input values',
proname => 'min', prokind => 'a', proisstrict => 'f', prorettype => 'bpchar',
proargtypes => 'bpchar', prosrc => 'aggregate_dummy' },
@@ -8343,7 +8349,7 @@
prosrc => 'generate_series_timestamptz' },
{ oid => '6274', descr => 'non-persistent series generator',
proname => 'generate_series', prorows => '1000',
- prosupport => 'generate_series_timestamp_support', proretset => 't',
+ prosupport => 'generate_series_timestamp_support', proretset => 't',
prorettype => 'timestamptz',
proargtypes => 'timestamptz timestamptz interval text',
prosrc => 'generate_series_timestamptz_at_zone' },
@@ -10358,6 +10364,12 @@
{ oid => '2987', descr => 'less-equal-greater',
proname => 'btrecordcmp', prorettype => 'int4',
proargtypes => 'record record', prosrc => 'btrecordcmp' },
+{ oid => '8597', descr => 'larger of two',
+ proname => 'record_larger', prorettype => 'record',
+ proargtypes => 'record record', prosrc => 'record_larger' },
+{ oid => '8598', descr => 'smaller of two',
+ proname => 'record_smaller', prorettype => 'record',
+ proargtypes => 'record record', prosrc => 'record_smaller' },
{ oid => '6192', descr => 'hash',
proname => 'hash_record', prorettype => 'int4', proargtypes => 'record',