@@ -320,7 +320,7 @@ SELECT count(*) FROM test.insert_into_select_copy;
320
320
321
321
DROP TABLE test.insert_into_select_copy, test.insert_into_select CASCADE;
322
322
NOTICE: drop cascades to 5 other objects
323
- /* test special case: ONLY statement with not-ONLY for partitioned table */
323
+ /* Test special case: ONLY statement with not-ONLY for partitioned table */
324
324
CREATE TABLE test.from_only_test(val INT NOT NULL);
325
325
INSERT INTO test.from_only_test SELECT generate_series(1, 20);
326
326
SELECT pathman.create_range_partitions('test.from_only_test', 'val', 1, 2);
@@ -1818,6 +1818,41 @@ EXPLAIN (COSTS OFF) SELECT * FROM test.range_rel WHERE dt = '2015-12-15';
1818
1818
Filter: (dt = 'Tue Dec 15 00:00:00 2015'::timestamp without time zone)
1819
1819
(3 rows)
1820
1820
1821
+ /* Test NOT operator */
1822
+ CREATE TABLE bool_test(a INT NOT NULL, b BOOLEAN);
1823
+ SELECT create_hash_partitions('bool_test', 'a', 3);
1824
+ create_hash_partitions
1825
+ ------------------------
1826
+ 3
1827
+ (1 row)
1828
+
1829
+ INSERT INTO bool_test SELECT g, (g % 4) = 0 FROM generate_series(1, 100) AS g;
1830
+ SELECT count(*) FROM bool_test;
1831
+ count
1832
+ -------
1833
+ 100
1834
+ (1 row)
1835
+
1836
+ SELECT count(*) FROM bool_test WHERE (b = true AND b = false);
1837
+ count
1838
+ -------
1839
+ 0
1840
+ (1 row)
1841
+
1842
+ SELECT count(*) FROM bool_test WHERE b = false; /* 75 values */
1843
+ count
1844
+ -------
1845
+ 75
1846
+ (1 row)
1847
+
1848
+ SELECT count(*) FROM bool_test WHERE b = true; /* 25 values */
1849
+ count
1850
+ -------
1851
+ 25
1852
+ (1 row)
1853
+
1854
+ DROP TABLE bool_test CASCADE;
1855
+ NOTICE: drop cascades to 3 other objects
1821
1856
/* Test foreign keys */
1822
1857
CREATE TABLE test.messages(id SERIAL PRIMARY KEY, msg TEXT);
1823
1858
CREATE TABLE test.replies(id SERIAL PRIMARY KEY, message_id INTEGER REFERENCES test.messages(id), msg TEXT);
0 commit comments