- Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathmoney.sql
34 lines (26 loc) · 1.02 KB
/
money.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* ------------------------------------
* NOTE: This test behaves differenly
* ------------------------------------
*
* money.out - test output for 64-bit systems and
* money_1.out - test output for 32-bit systems.
*
*/
set enable_seqscan=off;
CREATETABLEtest_money (
i money
);
INSERT INTO test_money VALUES ('-2'),('-1'),('0'),('1'),('2'),('3');
CREATEINDEXidx_moneyON test_money USING rum (i);
SELECT*FROM test_money WHERE i<'1'::moneyORDER BY i;
SELECT*FROM test_money WHERE i<='1'::moneyORDER BY i;
SELECT*FROM test_money WHERE i='1'::moneyORDER BY i;
SELECT*FROM test_money WHERE i>='1'::moneyORDER BY i;
SELECT*FROM test_money WHERE i>'1'::moneyORDER BY i;
EXPLAIN (costs off)
SELECT*, i <=>0::moneyFROM test_money ORDER BY i <=>0::money;
SELECT*, i <=>0::moneyFROM test_money ORDER BY i <=>0::money;
EXPLAIN (costs off)
SELECT*, i <=>1::moneyFROM test_money WHERE i<1::moneyORDER BY i <=>1::money;
SELECT*, i <=>1::moneyFROM test_money WHERE i<1::moneyORDER BY i <=>1::money;