summaryrefslogtreecommitdiffstats
path: root/contrib/btree_gist/sql/timetz.sql
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
commit293913568e6a7a86fd1479e1cff8e2ecb58d6568 (patch)
treefc3b469a3ec5ab71b36ea97cc7aaddb838423a0c /contrib/btree_gist/sql/timetz.sql
parentInitial commit. (diff)
downloadpostgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.tar.xz
postgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.zip
Adding upstream version 16.2.upstream/16.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'contrib/btree_gist/sql/timetz.sql')
-rw-r--r--contrib/btree_gist/sql/timetz.sql82
1 files changed, 82 insertions, 0 deletions
diff --git a/contrib/btree_gist/sql/timetz.sql b/contrib/btree_gist/sql/timetz.sql
new file mode 100644
index 0000000..2fb725d
--- /dev/null
+++ b/contrib/btree_gist/sql/timetz.sql
@@ -0,0 +1,82 @@
+-- timetz check
+
+CREATE TABLE timetztmp (a timetz);
+\copy timetztmp from 'data/timetz.data'
+
+CREATE TABLE timetzcmp ( r_id int2, a int4, b int4 );
+
+
+SET enable_seqscan=on;
+
+INSERT INTO timetzcmp (r_id,a) SELECT 1,count(*) FROM timetztmp WHERE a < '07:46:45 GMT+3';
+
+INSERT INTO timetzcmp (r_id,a) SELECT 2,count(*) FROM timetztmp WHERE a <= '07:46:45 GMT+3';
+
+INSERT INTO timetzcmp (r_id,a) SELECT 3,count(*) FROM timetztmp WHERE a = '07:46:45 GMT+3';
+
+INSERT INTO timetzcmp (r_id,a) SELECT 4,count(*) FROM timetztmp WHERE a >= '07:46:45 GMT+3';
+
+INSERT INTO timetzcmp (r_id,a) SELECT 5,count(*) FROM timetztmp WHERE a > '07:46:45 GMT+3';
+
+
+INSERT INTO timetzcmp (r_id,a) SELECT 11,count(*) FROM timetztmp WHERE a < '07:46:45 GMT+2';
+
+INSERT INTO timetzcmp (r_id,a) SELECT 12,count(*) FROM timetztmp WHERE a <= '07:46:45 GMT+2';
+
+INSERT INTO timetzcmp (r_id,a) SELECT 13,count(*) FROM timetztmp WHERE a = '07:46:45 GMT+2';
+
+INSERT INTO timetzcmp (r_id,a) SELECT 14,count(*) FROM timetztmp WHERE a >= '07:46:45 GMT+2';
+
+INSERT INTO timetzcmp (r_id,a) SELECT 15,count(*) FROM timetztmp WHERE a > '07:46:45 GMT+2';
+
+
+INSERT INTO timetzcmp (r_id,a) SELECT 21,count(*) FROM timetztmp WHERE a < '07:46:45 GMT+4';
+
+INSERT INTO timetzcmp (r_id,a) SELECT 22,count(*) FROM timetztmp WHERE a <= '07:46:45 GMT+4';
+
+INSERT INTO timetzcmp (r_id,a) SELECT 23,count(*) FROM timetztmp WHERE a = '07:46:45 GMT+4';
+
+INSERT INTO timetzcmp (r_id,a) SELECT 24,count(*) FROM timetztmp WHERE a >= '07:46:45 GMT+4';
+
+INSERT INTO timetzcmp (r_id,a) SELECT 25,count(*) FROM timetztmp WHERE a > '07:46:45 GMT+4';
+
+
+
+CREATE INDEX timetzidx ON timetztmp USING gist ( a );
+
+SET enable_seqscan=off;
+
+UPDATE timetzcmp SET b=c FROM ( SELECT count(*) AS c FROM timetztmp WHERE a < '07:46:45 GMT+3'::timetz ) q WHERE r_id=1 ;
+
+UPDATE timetzcmp SET b=c FROM ( SELECT count(*) AS c FROM timetztmp WHERE a <= '07:46:45 GMT+3'::timetz ) q WHERE r_id=2 ;
+
+UPDATE timetzcmp SET b=c FROM ( SELECT count(*) AS c FROM timetztmp WHERE a = '07:46:45 GMT+3'::timetz ) q WHERE r_id=3 ;
+
+UPDATE timetzcmp SET b=c FROM ( SELECT count(*) AS c FROM timetztmp WHERE a >= '07:46:45 GMT+3'::timetz ) q WHERE r_id=4 ;
+
+UPDATE timetzcmp SET b=c FROM ( SELECT count(*) AS c FROM timetztmp WHERE a > '07:46:45 GMT+3'::timetz ) q WHERE r_id=5 ;
+
+
+UPDATE timetzcmp SET b=c FROM ( SELECT count(*) AS c FROM timetztmp WHERE a < '07:46:45 GMT+2'::timetz ) q WHERE r_id=11 ;
+
+UPDATE timetzcmp SET b=c FROM ( SELECT count(*) AS c FROM timetztmp WHERE a <= '07:46:45 GMT+2'::timetz ) q WHERE r_id=12 ;
+
+UPDATE timetzcmp SET b=c FROM ( SELECT count(*) AS c FROM timetztmp WHERE a = '07:46:45 GMT+2'::timetz ) q WHERE r_id=13 ;
+
+UPDATE timetzcmp SET b=c FROM ( SELECT count(*) AS c FROM timetztmp WHERE a >= '07:46:45 GMT+2'::timetz ) q WHERE r_id=14 ;
+
+UPDATE timetzcmp SET b=c FROM ( SELECT count(*) AS c FROM timetztmp WHERE a > '07:46:45 GMT+2'::timetz ) q WHERE r_id=15 ;
+
+
+UPDATE timetzcmp SET b=c FROM ( SELECT count(*) AS c FROM timetztmp WHERE a < '07:46:45 GMT+4'::timetz ) q WHERE r_id=21 ;
+
+UPDATE timetzcmp SET b=c FROM ( SELECT count(*) AS c FROM timetztmp WHERE a <= '07:46:45 GMT+4'::timetz ) q WHERE r_id=22 ;
+
+UPDATE timetzcmp SET b=c FROM ( SELECT count(*) AS c FROM timetztmp WHERE a = '07:46:45 GMT+4'::timetz ) q WHERE r_id=23 ;
+
+UPDATE timetzcmp SET b=c FROM ( SELECT count(*) AS c FROM timetztmp WHERE a >= '07:46:45 GMT+4'::timetz ) q WHERE r_id=24 ;
+
+UPDATE timetzcmp SET b=c FROM ( SELECT count(*) AS c FROM timetztmp WHERE a > '07:46:45 GMT+4'::timetz ) q WHERE r_id=25 ;
+
+
+SELECT count(*) FROM timetzcmp WHERE a=b;