aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2022-02-10 12:33:41 +0900
committerFujii Masao <fujii@postgresql.org>2022-02-10 12:33:41 +0900
commit400fc6b6487ddf16aa82c9d76e5cfbe64d94f660 (patch)
tree220507135a4655581f534c1948a2ddef702602ff /src/test
parentadbd00f7a59bcfbcd6907858499c94a27c6680ed (diff)
downloadpostgresql-400fc6b6487ddf16aa82c9d76e5cfbe64d94f660.tar.gz
postgresql-400fc6b6487ddf16aa82c9d76e5cfbe64d94f660.zip
Add min() and max() aggregates for xid8.
Bump catalog version. Author: Ken Kato Reviewed-by: Kyotaro Horiguchi, Fujii Masao Discussion: https://postgr.es/m/47d77b18c44f87f8222c4c7a3e2dee6b@oss.nttdata.com
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/xid.out10
-rw-r--r--src/test/regress/sql/xid.sql6
2 files changed, 14 insertions, 2 deletions
diff --git a/src/test/regress/expected/xid.out b/src/test/regress/expected/xid.out
index b7a1ed0f9ee..d8e76f3321f 100644
--- a/src/test/regress/expected/xid.out
+++ b/src/test/regress/expected/xid.out
@@ -129,8 +129,16 @@ select xid8cmp('1', '2'), xid8cmp('2', '2'), xid8cmp('2', '1');
-1 | 0 | 1
(1 row)
--- xid8 has btree and hash opclasses
+-- min() and max() for xid8
create table xid8_t1 (x xid8);
+insert into xid8_t1 values ('0'), ('010'), ('42'), ('0xffffffffffffffff'), ('-1');
+select min(x), max(x) from xid8_t1;
+ min | max
+-----+----------------------
+ 0 | 18446744073709551615
+(1 row)
+
+-- xid8 has btree and hash opclasses
create index on xid8_t1 using btree(x);
create index on xid8_t1 using hash(x);
drop table xid8_t1;
diff --git a/src/test/regress/sql/xid.sql b/src/test/regress/sql/xid.sql
index 565714d4620..bee17e63643 100644
--- a/src/test/regress/sql/xid.sql
+++ b/src/test/regress/sql/xid.sql
@@ -41,8 +41,12 @@ select '1'::xid8 >= '2'::xid8, '2'::xid8 >= '2'::xid8, '2'::xid8 >= '1'::xid8;
-- we also have a 3way compare for btrees
select xid8cmp('1', '2'), xid8cmp('2', '2'), xid8cmp('2', '1');
--- xid8 has btree and hash opclasses
+-- min() and max() for xid8
create table xid8_t1 (x xid8);
+insert into xid8_t1 values ('0'), ('010'), ('42'), ('0xffffffffffffffff'), ('-1');
+select min(x), max(x) from xid8_t1;
+
+-- xid8 has btree and hash opclasses
create index on xid8_t1 using btree(x);
create index on xid8_t1 using hash(x);
drop table xid8_t1;