File: typmod.sql

package info (click to toggle)
postgresql-hll 2.18-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 58,720 kB
  • sloc: ansic: 2,805; sql: 2,160; cpp: 201; makefile: 22; sh: 1
file content (112 lines) | stat: -rw-r--r-- 3,181 bytes parent folder | download | duplicates (3)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
-- ----------------------------------------------------------------
-- Type Modifier Signature
-- ----------------------------------------------------------------

SELECT hll_set_output_version(1);

DROP TABLE IF EXISTS test_qiundgkm;

-- Using all defaults.
CREATE TABLE test_qiundgkm (v1 hll);
\d test_qiundgkm
DROP TABLE test_qiundgkm;

-- Partial defaults.
CREATE TABLE test_qiundgkm (v1 hll(10));
\d test_qiundgkm
DROP TABLE test_qiundgkm;

CREATE TABLE test_qiundgkm (v1 hll(10, 4));
\d test_qiundgkm
DROP TABLE test_qiundgkm;

CREATE TABLE test_qiundgkm (v1 hll(10, 4, 64));
\d test_qiundgkm
DROP TABLE test_qiundgkm;

CREATE TABLE test_qiundgkm (v1 hll(10, 4, 64, 0));
\d test_qiundgkm
DROP TABLE test_qiundgkm;

-- ERROR:  invalid number of type modifiers
CREATE TABLE test_qiundgkm (v1 hll(10, 4, 64, 0, 42));

-- ----------------------------------------------------------------
-- Range Check log2nregs
-- ----------------------------------------------------------------

-- ERROR:  log2m modifier must be between 0 and 17
CREATE TABLE test_qiundgkm (v1 hll(-1));

CREATE TABLE test_qiundgkm (v1 hll(0));
\d test_qiundgkm
DROP TABLE test_qiundgkm;

CREATE TABLE test_qiundgkm (v1 hll(31));
\d test_qiundgkm
DROP TABLE test_qiundgkm;

-- ERROR:  log2m modifier must be between 0 and 17
CREATE TABLE test_qiundgkm (v1 hll(32));

-- ----------------------------------------------------------------
-- Range Check regwidth
-- ----------------------------------------------------------------

-- ERROR:  regwidth modifier must be between 0 and 7
CREATE TABLE test_qiundgkm (v1 hll(11, -1));

CREATE TABLE test_qiundgkm (v1 hll(11, 0));
\d test_qiundgkm
DROP TABLE test_qiundgkm;

CREATE TABLE test_qiundgkm (v1 hll(11, 7));
\d test_qiundgkm
DROP TABLE test_qiundgkm;

-- ERROR:  regwidth modifier must be between 0 and 7
CREATE TABLE test_qiundgkm (v1 hll(11, 8));

-- ----------------------------------------------------------------
-- Range Check expthresh
-- ----------------------------------------------------------------

-- ERROR:  expthresh modifier must be between -1 and 16383
CREATE TABLE test_qiundgkm (v1 hll(11, 5, -2));

CREATE TABLE test_qiundgkm (v1 hll(11, 5, -1));
\d test_qiundgkm
DROP TABLE test_qiundgkm;

CREATE TABLE test_qiundgkm (v1 hll(11, 5, 0));
\d test_qiundgkm
DROP TABLE test_qiundgkm;

CREATE TABLE test_qiundgkm (v1 hll(11, 5, 128));
\d test_qiundgkm
DROP TABLE test_qiundgkm;

CREATE TABLE test_qiundgkm (v1 hll(11, 5, 4294967296));
\d test_qiundgkm
DROP TABLE test_qiundgkm;

-- ERROR:  expthresh modifier must be between -1 and 16383
CREATE TABLE test_qiundgkm (v1 hll(11, 5, 8589934592));

-- ----------------------------------------------------------------
-- Range Check nosparse
-- ----------------------------------------------------------------

-- ERROR:  nosparse modifier must be 0 or 1
CREATE TABLE test_qiundgkm (v1 hll(11, 5, 128, -1));

CREATE TABLE test_qiundgkm (v1 hll(11, 5, 128, 0));
\d test_qiundgkm
DROP TABLE test_qiundgkm;

CREATE TABLE test_qiundgkm (v1 hll(11, 5, 128, 1));
\d test_qiundgkm
DROP TABLE test_qiundgkm;

-- ERROR:  nosparse modifier must be 0 or 1
CREATE TABLE test_qiundgkm (v1 hll(11, 5, 128, 2));