mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
ef770cbb69
- Fix wrong index results on text, char, varchar for multibyte strings - Fix some SIGFPE signals - Add support for infinite timestamps - Because of locale settings, btree_gist can not be a prefix index anymore (for text). Each node holds now just the lower and upper boundary.
187 lines
3.6 KiB
Plaintext
187 lines
3.6 KiB
Plaintext
-- timestamptz check
|
|
CREATE TABLE timestamptztmp (a timestamptz);
|
|
\copy timestamptztmp from 'data/timestamptz.data'
|
|
SET enable_seqscan=on;
|
|
SELECT count(*) FROM timestamptztmp WHERE a < '2018-12-18 10:59:54 GMT+3';
|
|
count
|
|
-------
|
|
391
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a <= '2018-12-18 10:59:54 GMT+3';
|
|
count
|
|
-------
|
|
392
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a = '2018-12-18 10:59:54 GMT+3';
|
|
count
|
|
-------
|
|
1
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a >= '2018-12-18 10:59:54 GMT+3';
|
|
count
|
|
-------
|
|
158
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a > '2018-12-18 10:59:54 GMT+3';
|
|
count
|
|
-------
|
|
157
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a < '2018-12-18 10:59:54 GMT+2';
|
|
count
|
|
-------
|
|
391
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a <= '2018-12-18 10:59:54 GMT+2';
|
|
count
|
|
-------
|
|
391
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a = '2018-12-18 10:59:54 GMT+2';
|
|
count
|
|
-------
|
|
0
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a >= '2018-12-18 10:59:54 GMT+2';
|
|
count
|
|
-------
|
|
158
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a > '2018-12-18 10:59:54 GMT+2';
|
|
count
|
|
-------
|
|
158
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a < '2018-12-18 10:59:54 GMT+4';
|
|
count
|
|
-------
|
|
392
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a <= '2018-12-18 10:59:54 GMT+4';
|
|
count
|
|
-------
|
|
392
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a = '2018-12-18 10:59:54 GMT+4';
|
|
count
|
|
-------
|
|
0
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a >= '2018-12-18 10:59:54 GMT+4';
|
|
count
|
|
-------
|
|
157
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a > '2018-12-18 10:59:54 GMT+4';
|
|
count
|
|
-------
|
|
157
|
|
(1 row)
|
|
|
|
CREATE INDEX timestamptzidx ON timestamptztmp USING gist ( a );
|
|
SET enable_seqscan=off;
|
|
SELECT count(*) FROM timestamptztmp WHERE a < '2018-12-18 10:59:54 GMT+3'::timestamptz;
|
|
count
|
|
-------
|
|
391
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a <= '2018-12-18 10:59:54 GMT+3'::timestamptz;
|
|
count
|
|
-------
|
|
392
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a = '2018-12-18 10:59:54 GMT+3'::timestamptz;
|
|
count
|
|
-------
|
|
1
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a >= '2018-12-18 10:59:54 GMT+3'::timestamptz;
|
|
count
|
|
-------
|
|
158
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a > '2018-12-18 10:59:54 GMT+3'::timestamptz;
|
|
count
|
|
-------
|
|
157
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a < '2018-12-18 10:59:54 GMT+2'::timestamptz;
|
|
count
|
|
-------
|
|
391
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a <= '2018-12-18 10:59:54 GMT+2'::timestamptz;
|
|
count
|
|
-------
|
|
391
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a = '2018-12-18 10:59:54 GMT+2'::timestamptz;
|
|
count
|
|
-------
|
|
0
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a >= '2018-12-18 10:59:54 GMT+2'::timestamptz;
|
|
count
|
|
-------
|
|
158
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a > '2018-12-18 10:59:54 GMT+2'::timestamptz;
|
|
count
|
|
-------
|
|
158
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a < '2018-12-18 10:59:54 GMT+4'::timestamptz;
|
|
count
|
|
-------
|
|
392
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a <= '2018-12-18 10:59:54 GMT+4'::timestamptz;
|
|
count
|
|
-------
|
|
392
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a = '2018-12-18 10:59:54 GMT+4'::timestamptz;
|
|
count
|
|
-------
|
|
0
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a >= '2018-12-18 10:59:54 GMT+4'::timestamptz;
|
|
count
|
|
-------
|
|
157
|
|
(1 row)
|
|
|
|
SELECT count(*) FROM timestamptztmp WHERE a > '2018-12-18 10:59:54 GMT+4'::timestamptz;
|
|
count
|
|
-------
|
|
157
|
|
(1 row)
|
|
|