globegit-postgresql-plruby 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. data/Changes +121 -0
  2. data/README.markdown +155 -0
  3. data/Rakefile +48 -0
  4. data/docs/plruby.rb +1931 -0
  5. data/ex_trans.sql +33 -0
  6. data/extconf.rb +267 -0
  7. data/plruby.html +1454 -0
  8. data/plruby.rd +1571 -0
  9. data/postgresql-plruby.gemspec +56 -0
  10. data/src/conversions.h +5 -0
  11. data/src/conversions/basic/conversions.h +25 -0
  12. data/src/conversions/basic/extconf.rb +8 -0
  13. data/src/conversions/basic/plruby_basic.c +357 -0
  14. data/src/conversions/bitstring/bitstring.sql +75 -0
  15. data/src/conversions/bitstring/conversions.h +15 -0
  16. data/src/conversions/bitstring/extconf.rb +8 -0
  17. data/src/conversions/bitstring/plruby_bitstring.c +579 -0
  18. data/src/conversions/convcommon.h +129 -0
  19. data/src/conversions/datetime/conversions.h +13 -0
  20. data/src/conversions/datetime/extconf.rb +8 -0
  21. data/src/conversions/datetime/plruby_datetime.c +269 -0
  22. data/src/conversions/geometry/conversions.h +37 -0
  23. data/src/conversions/geometry/extconf.rb +8 -0
  24. data/src/conversions/geometry/geometry.sql +196 -0
  25. data/src/conversions/geometry/plruby_geometry.c +2494 -0
  26. data/src/conversions/network/conversions.h +21 -0
  27. data/src/conversions/network/extconf.rb +8 -0
  28. data/src/conversions/network/network.sql +63 -0
  29. data/src/conversions/network/plruby_network.c +537 -0
  30. data/src/package.h +20 -0
  31. data/src/plpl.c +1708 -0
  32. data/src/plplan.c +893 -0
  33. data/src/plruby.c +1676 -0
  34. data/src/plruby.h +324 -0
  35. data/src/pltrans.c +388 -0
  36. data/test/conv_bitstring/b.rb +45 -0
  37. data/test/conv_bitstring/runtest +26 -0
  38. data/test/conv_bitstring/test.expected.73 +148 -0
  39. data/test/conv_bitstring/test.expected.74 +148 -0
  40. data/test/conv_bitstring/test.expected.80 +148 -0
  41. data/test/conv_bitstring/test.expected.81 +148 -0
  42. data/test/conv_bitstring/test.expected.82 +148 -0
  43. data/test/conv_bitstring/test.expected.83 +148 -0
  44. data/test/conv_bitstring/test.expected.84 +148 -0
  45. data/test/conv_bitstring/test.out +148 -0
  46. data/test/conv_bitstring/test_mklang.sql +8 -0
  47. data/test/conv_bitstring/test_queries.sql +63 -0
  48. data/test/conv_bitstring/test_queries.sql.in +63 -0
  49. data/test/conv_geometry/b.rb +45 -0
  50. data/test/conv_geometry/runtest +26 -0
  51. data/test/conv_geometry/test.expected.73 +265 -0
  52. data/test/conv_geometry/test.expected.74 +265 -0
  53. data/test/conv_geometry/test.expected.80 +265 -0
  54. data/test/conv_geometry/test.expected.81 +265 -0
  55. data/test/conv_geometry/test.expected.82 +265 -0
  56. data/test/conv_geometry/test.expected.83 +265 -0
  57. data/test/conv_geometry/test.expected.84 +265 -0
  58. data/test/conv_geometry/test.out +265 -0
  59. data/test/conv_geometry/test_mklang.sql +8 -0
  60. data/test/conv_geometry/test_queries.sql +194 -0
  61. data/test/conv_geometry/test_queries.sql.in +194 -0
  62. data/test/conv_network/b.rb +45 -0
  63. data/test/conv_network/runtest +26 -0
  64. data/test/conv_network/test.expected.73 +213 -0
  65. data/test/conv_network/test.expected.74 +237 -0
  66. data/test/conv_network/test.expected.80 +237 -0
  67. data/test/conv_network/test.expected.81 +237 -0
  68. data/test/conv_network/test.expected.82 +237 -0
  69. data/test/conv_network/test.expected.83 +237 -0
  70. data/test/conv_network/test.expected.84 +237 -0
  71. data/test/conv_network/test.out +237 -0
  72. data/test/conv_network/test_mklang.sql +8 -0
  73. data/test/conv_network/test_queries.sql +60 -0
  74. data/test/conv_network/test_queries.sql.in +60 -0
  75. data/test/plp/b.rb +34 -0
  76. data/test/plp/runtest +29 -0
  77. data/test/plp/test.expected.73 +472 -0
  78. data/test/plp/test.expected.74 +472 -0
  79. data/test/plp/test.expected.75 +472 -0
  80. data/test/plp/test.expected.80 +472 -0
  81. data/test/plp/test.expected.81 +472 -0
  82. data/test/plp/test.expected.82 +472 -0
  83. data/test/plp/test.expected.83 +472 -0
  84. data/test/plp/test.expected.84 +472 -0
  85. data/test/plp/test.out +472 -0
  86. data/test/plp/test_mklang.sql +8 -0
  87. data/test/plp/test_queries.sql +273 -0
  88. data/test/plp/test_setup.sql +931 -0
  89. data/test/plp/test_setup.sql.in +931 -0
  90. data/test/plt/b.rb +34 -0
  91. data/test/plt/runtest +29 -0
  92. data/test/plt/test.expected.73 +178 -0
  93. data/test/plt/test.expected.74 +178 -0
  94. data/test/plt/test.expected.75 +178 -0
  95. data/test/plt/test.expected.80 +178 -0
  96. data/test/plt/test.expected.81 +178 -0
  97. data/test/plt/test.expected.82 +178 -0
  98. data/test/plt/test.expected.83 +164 -0
  99. data/test/plt/test.expected.84 +168 -0
  100. data/test/plt/test.out +168 -0
  101. data/test/plt/test_mklang.sql +8 -0
  102. data/test/plt/test_queries.sql +72 -0
  103. data/test/plt/test_setup.sql +252 -0
  104. data/test/plt/test_setup.sql.in +252 -0
  105. data/test/range/b.rb +45 -0
  106. data/test/range/runtest +26 -0
  107. data/test/range/test.expected.73 +396 -0
  108. data/test/range/test.expected.73.in +396 -0
  109. data/test/range/test.expected.74 +396 -0
  110. data/test/range/test.expected.74.in +396 -0
  111. data/test/range/test.expected.75 +396 -0
  112. data/test/range/test.expected.75.in +396 -0
  113. data/test/range/test.expected.80 +396 -0
  114. data/test/range/test.expected.81 +397 -0
  115. data/test/range/test.expected.82 +397 -0
  116. data/test/range/test.expected.83 +397 -0
  117. data/test/range/test.expected.84 +399 -0
  118. data/test/range/test.out +399 -0
  119. data/test/range/test_mklang.sql +8 -0
  120. data/test/range/test_queries.sql +249 -0
  121. data/test/range/test_queries.sql.in +249 -0
  122. metadata +207 -0
@@ -0,0 +1,472 @@
1
+ insert into Room values ('001', 'Entrance');
2
+ insert into Room values ('002', 'Office');
3
+ insert into Room values ('003', 'Office');
4
+ insert into Room values ('004', 'Technical');
5
+ insert into Room values ('101', 'Office');
6
+ insert into Room values ('102', 'Conference');
7
+ insert into Room values ('103', 'Restroom');
8
+ insert into Room values ('104', 'Technical');
9
+ insert into Room values ('105', 'Office');
10
+ insert into Room values ('106', 'Office');
11
+ insert into WSlot values ('WS.001.1a', '001', '', '');
12
+ insert into WSlot values ('WS.001.1b', '001', '', '');
13
+ insert into WSlot values ('WS.001.2a', '001', '', '');
14
+ insert into WSlot values ('WS.001.2b', '001', '', '');
15
+ insert into WSlot values ('WS.001.3a', '001', '', '');
16
+ insert into WSlot values ('WS.001.3b', '001', '', '');
17
+ insert into WSlot values ('WS.002.1a', '002', '', '');
18
+ insert into WSlot values ('WS.002.1b', '002', '', '');
19
+ insert into WSlot values ('WS.002.2a', '002', '', '');
20
+ insert into WSlot values ('WS.002.2b', '002', '', '');
21
+ insert into WSlot values ('WS.002.3a', '002', '', '');
22
+ insert into WSlot values ('WS.002.3b', '002', '', '');
23
+ insert into WSlot values ('WS.003.1a', '003', '', '');
24
+ insert into WSlot values ('WS.003.1b', '003', '', '');
25
+ insert into WSlot values ('WS.003.2a', '003', '', '');
26
+ insert into WSlot values ('WS.003.2b', '003', '', '');
27
+ insert into WSlot values ('WS.003.3a', '003', '', '');
28
+ insert into WSlot values ('WS.003.3b', '003', '', '');
29
+ insert into WSlot values ('WS.101.1a', '101', '', '');
30
+ insert into WSlot values ('WS.101.1b', '101', '', '');
31
+ insert into WSlot values ('WS.101.2a', '101', '', '');
32
+ insert into WSlot values ('WS.101.2b', '101', '', '');
33
+ insert into WSlot values ('WS.101.3a', '101', '', '');
34
+ insert into WSlot values ('WS.101.3b', '101', '', '');
35
+ insert into WSlot values ('WS.102.1a', '102', '', '');
36
+ insert into WSlot values ('WS.102.1b', '102', '', '');
37
+ insert into WSlot values ('WS.102.2a', '102', '', '');
38
+ insert into WSlot values ('WS.102.2b', '102', '', '');
39
+ insert into WSlot values ('WS.102.3a', '102', '', '');
40
+ insert into WSlot values ('WS.102.3b', '102', '', '');
41
+ insert into WSlot values ('WS.105.1a', '105', '', '');
42
+ insert into WSlot values ('WS.105.1b', '105', '', '');
43
+ insert into WSlot values ('WS.105.2a', '105', '', '');
44
+ insert into WSlot values ('WS.105.2b', '105', '', '');
45
+ insert into WSlot values ('WS.105.3a', '105', '', '');
46
+ insert into WSlot values ('WS.105.3b', '105', '', '');
47
+ insert into WSlot values ('WS.106.1a', '106', '', '');
48
+ insert into WSlot values ('WS.106.1b', '106', '', '');
49
+ insert into WSlot values ('WS.106.2a', '106', '', '');
50
+ insert into WSlot values ('WS.106.2b', '106', '', '');
51
+ insert into WSlot values ('WS.106.3a', '106', '', '');
52
+ insert into WSlot values ('WS.106.3b', '106', '', '');
53
+ insert into PField values ('PF0_1', 'Wallslots basement');
54
+ insert into PSlot values ('PS.base.a1', 'PF0_1', '', '');
55
+ insert into PSlot values ('PS.base.a2', 'PF0_1', '', '');
56
+ insert into PSlot values ('PS.base.a3', 'PF0_1', '', '');
57
+ insert into PSlot values ('PS.base.a4', 'PF0_1', '', '');
58
+ insert into PSlot values ('PS.base.a5', 'PF0_1', '', '');
59
+ insert into PSlot values ('PS.base.a6', 'PF0_1', '', '');
60
+ insert into PSlot values ('PS.base.b1', 'PF0_1', '', 'WS.002.1a');
61
+ insert into PSlot values ('PS.base.b2', 'PF0_1', '', 'WS.002.1b');
62
+ insert into PSlot values ('PS.base.b3', 'PF0_1', '', 'WS.002.2a');
63
+ insert into PSlot values ('PS.base.b4', 'PF0_1', '', 'WS.002.2b');
64
+ insert into PSlot values ('PS.base.b5', 'PF0_1', '', 'WS.002.3a');
65
+ insert into PSlot values ('PS.base.b6', 'PF0_1', '', 'WS.002.3b');
66
+ insert into PSlot values ('PS.base.c1', 'PF0_1', '', 'WS.003.1a');
67
+ insert into PSlot values ('PS.base.c2', 'PF0_1', '', 'WS.003.1b');
68
+ insert into PSlot values ('PS.base.c3', 'PF0_1', '', 'WS.003.2a');
69
+ insert into PSlot values ('PS.base.c4', 'PF0_1', '', 'WS.003.2b');
70
+ insert into PSlot values ('PS.base.c5', 'PF0_1', '', 'WS.003.3a');
71
+ insert into PSlot values ('PS.base.c6', 'PF0_1', '', 'WS.003.3b');
72
+ insert into PField values ('PF0_X', 'Phonelines basement');
73
+ insert into PSlot values ('PS.base.ta1', 'PF0_X', '', '');
74
+ insert into PSlot values ('PS.base.ta2', 'PF0_X', '', '');
75
+ insert into PSlot values ('PS.base.ta3', 'PF0_X', '', '');
76
+ insert into PSlot values ('PS.base.ta4', 'PF0_X', '', '');
77
+ insert into PSlot values ('PS.base.ta5', 'PF0_X', '', '');
78
+ insert into PSlot values ('PS.base.ta6', 'PF0_X', '', '');
79
+ insert into PSlot values ('PS.base.tb1', 'PF0_X', '', '');
80
+ insert into PSlot values ('PS.base.tb2', 'PF0_X', '', '');
81
+ insert into PSlot values ('PS.base.tb3', 'PF0_X', '', '');
82
+ insert into PSlot values ('PS.base.tb4', 'PF0_X', '', '');
83
+ insert into PSlot values ('PS.base.tb5', 'PF0_X', '', '');
84
+ insert into PSlot values ('PS.base.tb6', 'PF0_X', '', '');
85
+ insert into PField values ('PF1_1', 'Wallslots 1st floor');
86
+ insert into PSlot values ('PS.1st.a1', 'PF1_1', '', 'WS.101.1a');
87
+ insert into PSlot values ('PS.1st.a2', 'PF1_1', '', 'WS.101.1b');
88
+ insert into PSlot values ('PS.1st.a3', 'PF1_1', '', 'WS.101.2a');
89
+ insert into PSlot values ('PS.1st.a4', 'PF1_1', '', 'WS.101.2b');
90
+ insert into PSlot values ('PS.1st.a5', 'PF1_1', '', 'WS.101.3a');
91
+ insert into PSlot values ('PS.1st.a6', 'PF1_1', '', 'WS.101.3b');
92
+ insert into PSlot values ('PS.1st.b1', 'PF1_1', '', 'WS.102.1a');
93
+ insert into PSlot values ('PS.1st.b2', 'PF1_1', '', 'WS.102.1b');
94
+ insert into PSlot values ('PS.1st.b3', 'PF1_1', '', 'WS.102.2a');
95
+ insert into PSlot values ('PS.1st.b4', 'PF1_1', '', 'WS.102.2b');
96
+ insert into PSlot values ('PS.1st.b5', 'PF1_1', '', 'WS.102.3a');
97
+ insert into PSlot values ('PS.1st.b6', 'PF1_1', '', 'WS.102.3b');
98
+ insert into PSlot values ('PS.1st.c1', 'PF1_1', '', 'WS.105.1a');
99
+ insert into PSlot values ('PS.1st.c2', 'PF1_1', '', 'WS.105.1b');
100
+ insert into PSlot values ('PS.1st.c3', 'PF1_1', '', 'WS.105.2a');
101
+ insert into PSlot values ('PS.1st.c4', 'PF1_1', '', 'WS.105.2b');
102
+ insert into PSlot values ('PS.1st.c5', 'PF1_1', '', 'WS.105.3a');
103
+ insert into PSlot values ('PS.1st.c6', 'PF1_1', '', 'WS.105.3b');
104
+ insert into PSlot values ('PS.1st.d1', 'PF1_1', '', 'WS.106.1a');
105
+ insert into PSlot values ('PS.1st.d2', 'PF1_1', '', 'WS.106.1b');
106
+ insert into PSlot values ('PS.1st.d3', 'PF1_1', '', 'WS.106.2a');
107
+ insert into PSlot values ('PS.1st.d4', 'PF1_1', '', 'WS.106.2b');
108
+ insert into PSlot values ('PS.1st.d5', 'PF1_1', '', 'WS.106.3a');
109
+ insert into PSlot values ('PS.1st.d6', 'PF1_1', '', 'WS.106.3b');
110
+ update PSlot set backlink = 'WS.001.1a' where slotname = 'PS.base.a1';
111
+ update PSlot set backlink = 'WS.001.1b' where slotname = 'PS.base.a3';
112
+ select * from WSlot where roomno = '001' order by slotname;
113
+ slotname | roomno | slotlink | backlink
114
+ -----------+--------+----------+------------
115
+ WS.001.1a | 001 | | PS.base.a1
116
+ WS.001.1b | 001 | | PS.base.a3
117
+ WS.001.2a | 001 | |
118
+ WS.001.2b | 001 | |
119
+ WS.001.3a | 001 | |
120
+ WS.001.3b | 001 | |
121
+ (6 rows)
122
+
123
+ select * from PSlot where slotname ~ 'PS.base.a' order by slotname;
124
+ slotname | pfname | slotlink | backlink
125
+ ------------+--------+----------+-----------
126
+ PS.base.a1 | PF0_1 | | WS.001.1a
127
+ PS.base.a2 | PF0_1 | |
128
+ PS.base.a3 | PF0_1 | | WS.001.1b
129
+ PS.base.a4 | PF0_1 | |
130
+ PS.base.a5 | PF0_1 | |
131
+ PS.base.a6 | PF0_1 | |
132
+ (6 rows)
133
+
134
+ update PSlot set backlink = 'WS.001.2a' where slotname = 'PS.base.a3';
135
+ select * from WSlot where roomno = '001' order by slotname;
136
+ slotname | roomno | slotlink | backlink
137
+ -----------+--------+----------+------------
138
+ WS.001.1a | 001 | | PS.base.a1
139
+ WS.001.1b | 001 | |
140
+ WS.001.2a | 001 | | PS.base.a3
141
+ WS.001.2b | 001 | |
142
+ WS.001.3a | 001 | |
143
+ WS.001.3b | 001 | |
144
+ (6 rows)
145
+
146
+ select * from PSlot where slotname ~ 'PS.base.a' order by slotname;
147
+ slotname | pfname | slotlink | backlink
148
+ ------------+--------+----------+-----------
149
+ PS.base.a1 | PF0_1 | | WS.001.1a
150
+ PS.base.a2 | PF0_1 | |
151
+ PS.base.a3 | PF0_1 | | WS.001.2a
152
+ PS.base.a4 | PF0_1 | |
153
+ PS.base.a5 | PF0_1 | |
154
+ PS.base.a6 | PF0_1 | |
155
+ (6 rows)
156
+
157
+ update PSlot set backlink = 'WS.001.1b' where slotname = 'PS.base.a2';
158
+ select * from WSlot where roomno = '001' order by slotname;
159
+ slotname | roomno | slotlink | backlink
160
+ -----------+--------+----------+------------
161
+ WS.001.1a | 001 | | PS.base.a1
162
+ WS.001.1b | 001 | | PS.base.a2
163
+ WS.001.2a | 001 | | PS.base.a3
164
+ WS.001.2b | 001 | |
165
+ WS.001.3a | 001 | |
166
+ WS.001.3b | 001 | |
167
+ (6 rows)
168
+
169
+ select * from PSlot where slotname ~ 'PS.base.a' order by slotname;
170
+ slotname | pfname | slotlink | backlink
171
+ ------------+--------+----------+-----------
172
+ PS.base.a1 | PF0_1 | | WS.001.1a
173
+ PS.base.a2 | PF0_1 | | WS.001.1b
174
+ PS.base.a3 | PF0_1 | | WS.001.2a
175
+ PS.base.a4 | PF0_1 | |
176
+ PS.base.a5 | PF0_1 | |
177
+ PS.base.a6 | PF0_1 | |
178
+ (6 rows)
179
+
180
+ update WSlot set backlink = 'PS.base.a4' where slotname = 'WS.001.2b';
181
+ update WSlot set backlink = 'PS.base.a6' where slotname = 'WS.001.3a';
182
+ select * from WSlot where roomno = '001' order by slotname;
183
+ slotname | roomno | slotlink | backlink
184
+ -----------+--------+----------+------------
185
+ WS.001.1a | 001 | | PS.base.a1
186
+ WS.001.1b | 001 | | PS.base.a2
187
+ WS.001.2a | 001 | | PS.base.a3
188
+ WS.001.2b | 001 | | PS.base.a4
189
+ WS.001.3a | 001 | | PS.base.a6
190
+ WS.001.3b | 001 | |
191
+ (6 rows)
192
+
193
+ select * from PSlot where slotname ~ 'PS.base.a' order by slotname;
194
+ slotname | pfname | slotlink | backlink
195
+ ------------+--------+----------+-----------
196
+ PS.base.a1 | PF0_1 | | WS.001.1a
197
+ PS.base.a2 | PF0_1 | | WS.001.1b
198
+ PS.base.a3 | PF0_1 | | WS.001.2a
199
+ PS.base.a4 | PF0_1 | | WS.001.2b
200
+ PS.base.a5 | PF0_1 | |
201
+ PS.base.a6 | PF0_1 | | WS.001.3a
202
+ (6 rows)
203
+
204
+ update WSlot set backlink = 'PS.base.a6' where slotname = 'WS.001.3b';
205
+ select * from WSlot where roomno = '001' order by slotname;
206
+ slotname | roomno | slotlink | backlink
207
+ -----------+--------+----------+------------
208
+ WS.001.1a | 001 | | PS.base.a1
209
+ WS.001.1b | 001 | | PS.base.a2
210
+ WS.001.2a | 001 | | PS.base.a3
211
+ WS.001.2b | 001 | | PS.base.a4
212
+ WS.001.3a | 001 | |
213
+ WS.001.3b | 001 | | PS.base.a6
214
+ (6 rows)
215
+
216
+ select * from PSlot where slotname ~ 'PS.base.a' order by slotname;
217
+ slotname | pfname | slotlink | backlink
218
+ ------------+--------+----------+-----------
219
+ PS.base.a1 | PF0_1 | | WS.001.1a
220
+ PS.base.a2 | PF0_1 | | WS.001.1b
221
+ PS.base.a3 | PF0_1 | | WS.001.2a
222
+ PS.base.a4 | PF0_1 | | WS.001.2b
223
+ PS.base.a5 | PF0_1 | |
224
+ PS.base.a6 | PF0_1 | | WS.001.3b
225
+ (6 rows)
226
+
227
+ update WSlot set backlink = 'PS.base.a5' where slotname = 'WS.001.3a';
228
+ select * from WSlot where roomno = '001' order by slotname;
229
+ slotname | roomno | slotlink | backlink
230
+ -----------+--------+----------+------------
231
+ WS.001.1a | 001 | | PS.base.a1
232
+ WS.001.1b | 001 | | PS.base.a2
233
+ WS.001.2a | 001 | | PS.base.a3
234
+ WS.001.2b | 001 | | PS.base.a4
235
+ WS.001.3a | 001 | | PS.base.a5
236
+ WS.001.3b | 001 | | PS.base.a6
237
+ (6 rows)
238
+
239
+ select * from PSlot where slotname ~ 'PS.base.a' order by slotname;
240
+ slotname | pfname | slotlink | backlink
241
+ ------------+--------+----------+-----------
242
+ PS.base.a1 | PF0_1 | | WS.001.1a
243
+ PS.base.a2 | PF0_1 | | WS.001.1b
244
+ PS.base.a3 | PF0_1 | | WS.001.2a
245
+ PS.base.a4 | PF0_1 | | WS.001.2b
246
+ PS.base.a5 | PF0_1 | | WS.001.3a
247
+ PS.base.a6 | PF0_1 | | WS.001.3b
248
+ (6 rows)
249
+
250
+ insert into PField values ('PF1_2', 'Phonelines 1st floor');
251
+ insert into PSlot values ('PS.1st.ta1', 'PF1_2', '', '');
252
+ insert into PSlot values ('PS.1st.ta2', 'PF1_2', '', '');
253
+ insert into PSlot values ('PS.1st.ta3', 'PF1_2', '', '');
254
+ insert into PSlot values ('PS.1st.ta4', 'PF1_2', '', '');
255
+ insert into PSlot values ('PS.1st.ta5', 'PF1_2', '', '');
256
+ insert into PSlot values ('PS.1st.ta6', 'PF1_2', '', '');
257
+ insert into PSlot values ('PS.1st.tb1', 'PF1_2', '', '');
258
+ insert into PSlot values ('PS.1st.tb2', 'PF1_2', '', '');
259
+ insert into PSlot values ('PS.1st.tb3', 'PF1_2', '', '');
260
+ insert into PSlot values ('PS.1st.tb4', 'PF1_2', '', '');
261
+ insert into PSlot values ('PS.1st.tb5', 'PF1_2', '', '');
262
+ insert into PSlot values ('PS.1st.tb6', 'PF1_2', '', '');
263
+ update PField set name = 'PF0_2' where name = 'PF0_X';
264
+ select * from PSlot order by slotname;
265
+ slotname | pfname | slotlink | backlink
266
+ -------------+--------+----------+-----------
267
+ PS.1st.a1 | PF1_1 | | WS.101.1a
268
+ PS.1st.a2 | PF1_1 | | WS.101.1b
269
+ PS.1st.a3 | PF1_1 | | WS.101.2a
270
+ PS.1st.a4 | PF1_1 | | WS.101.2b
271
+ PS.1st.a5 | PF1_1 | | WS.101.3a
272
+ PS.1st.a6 | PF1_1 | | WS.101.3b
273
+ PS.1st.b1 | PF1_1 | | WS.102.1a
274
+ PS.1st.b2 | PF1_1 | | WS.102.1b
275
+ PS.1st.b3 | PF1_1 | | WS.102.2a
276
+ PS.1st.b4 | PF1_1 | | WS.102.2b
277
+ PS.1st.b5 | PF1_1 | | WS.102.3a
278
+ PS.1st.b6 | PF1_1 | | WS.102.3b
279
+ PS.1st.c1 | PF1_1 | | WS.105.1a
280
+ PS.1st.c2 | PF1_1 | | WS.105.1b
281
+ PS.1st.c3 | PF1_1 | | WS.105.2a
282
+ PS.1st.c4 | PF1_1 | | WS.105.2b
283
+ PS.1st.c5 | PF1_1 | | WS.105.3a
284
+ PS.1st.c6 | PF1_1 | | WS.105.3b
285
+ PS.1st.d1 | PF1_1 | | WS.106.1a
286
+ PS.1st.d2 | PF1_1 | | WS.106.1b
287
+ PS.1st.d3 | PF1_1 | | WS.106.2a
288
+ PS.1st.d4 | PF1_1 | | WS.106.2b
289
+ PS.1st.d5 | PF1_1 | | WS.106.3a
290
+ PS.1st.d6 | PF1_1 | | WS.106.3b
291
+ PS.1st.ta1 | PF1_2 | |
292
+ PS.1st.ta2 | PF1_2 | |
293
+ PS.1st.ta3 | PF1_2 | |
294
+ PS.1st.ta4 | PF1_2 | |
295
+ PS.1st.ta5 | PF1_2 | |
296
+ PS.1st.ta6 | PF1_2 | |
297
+ PS.1st.tb1 | PF1_2 | |
298
+ PS.1st.tb2 | PF1_2 | |
299
+ PS.1st.tb3 | PF1_2 | |
300
+ PS.1st.tb4 | PF1_2 | |
301
+ PS.1st.tb5 | PF1_2 | |
302
+ PS.1st.tb6 | PF1_2 | |
303
+ PS.base.a1 | PF0_1 | | WS.001.1a
304
+ PS.base.a2 | PF0_1 | | WS.001.1b
305
+ PS.base.a3 | PF0_1 | | WS.001.2a
306
+ PS.base.a4 | PF0_1 | | WS.001.2b
307
+ PS.base.a5 | PF0_1 | | WS.001.3a
308
+ PS.base.a6 | PF0_1 | | WS.001.3b
309
+ PS.base.b1 | PF0_1 | | WS.002.1a
310
+ PS.base.b2 | PF0_1 | | WS.002.1b
311
+ PS.base.b3 | PF0_1 | | WS.002.2a
312
+ PS.base.b4 | PF0_1 | | WS.002.2b
313
+ PS.base.b5 | PF0_1 | | WS.002.3a
314
+ PS.base.b6 | PF0_1 | | WS.002.3b
315
+ PS.base.c1 | PF0_1 | | WS.003.1a
316
+ PS.base.c2 | PF0_1 | | WS.003.1b
317
+ PS.base.c3 | PF0_1 | | WS.003.2a
318
+ PS.base.c4 | PF0_1 | | WS.003.2b
319
+ PS.base.c5 | PF0_1 | | WS.003.3a
320
+ PS.base.c6 | PF0_1 | | WS.003.3b
321
+ PS.base.ta1 | PF0_2 | |
322
+ PS.base.ta2 | PF0_2 | |
323
+ PS.base.ta3 | PF0_2 | |
324
+ PS.base.ta4 | PF0_2 | |
325
+ PS.base.ta5 | PF0_2 | |
326
+ PS.base.ta6 | PF0_2 | |
327
+ PS.base.tb1 | PF0_2 | |
328
+ PS.base.tb2 | PF0_2 | |
329
+ PS.base.tb3 | PF0_2 | |
330
+ PS.base.tb4 | PF0_2 | |
331
+ PS.base.tb5 | PF0_2 | |
332
+ PS.base.tb6 | PF0_2 | |
333
+ (66 rows)
334
+
335
+ select * from WSlot order by slotname;
336
+ slotname | roomno | slotlink | backlink
337
+ -----------+--------+----------+------------
338
+ WS.001.1a | 001 | | PS.base.a1
339
+ WS.001.1b | 001 | | PS.base.a2
340
+ WS.001.2a | 001 | | PS.base.a3
341
+ WS.001.2b | 001 | | PS.base.a4
342
+ WS.001.3a | 001 | | PS.base.a5
343
+ WS.001.3b | 001 | | PS.base.a6
344
+ WS.002.1a | 002 | | PS.base.b1
345
+ WS.002.1b | 002 | | PS.base.b2
346
+ WS.002.2a | 002 | | PS.base.b3
347
+ WS.002.2b | 002 | | PS.base.b4
348
+ WS.002.3a | 002 | | PS.base.b5
349
+ WS.002.3b | 002 | | PS.base.b6
350
+ WS.003.1a | 003 | | PS.base.c1
351
+ WS.003.1b | 003 | | PS.base.c2
352
+ WS.003.2a | 003 | | PS.base.c3
353
+ WS.003.2b | 003 | | PS.base.c4
354
+ WS.003.3a | 003 | | PS.base.c5
355
+ WS.003.3b | 003 | | PS.base.c6
356
+ WS.101.1a | 101 | | PS.1st.a1
357
+ WS.101.1b | 101 | | PS.1st.a2
358
+ WS.101.2a | 101 | | PS.1st.a3
359
+ WS.101.2b | 101 | | PS.1st.a4
360
+ WS.101.3a | 101 | | PS.1st.a5
361
+ WS.101.3b | 101 | | PS.1st.a6
362
+ WS.102.1a | 102 | | PS.1st.b1
363
+ WS.102.1b | 102 | | PS.1st.b2
364
+ WS.102.2a | 102 | | PS.1st.b3
365
+ WS.102.2b | 102 | | PS.1st.b4
366
+ WS.102.3a | 102 | | PS.1st.b5
367
+ WS.102.3b | 102 | | PS.1st.b6
368
+ WS.105.1a | 105 | | PS.1st.c1
369
+ WS.105.1b | 105 | | PS.1st.c2
370
+ WS.105.2a | 105 | | PS.1st.c3
371
+ WS.105.2b | 105 | | PS.1st.c4
372
+ WS.105.3a | 105 | | PS.1st.c5
373
+ WS.105.3b | 105 | | PS.1st.c6
374
+ WS.106.1a | 106 | | PS.1st.d1
375
+ WS.106.1b | 106 | | PS.1st.d2
376
+ WS.106.2a | 106 | | PS.1st.d3
377
+ WS.106.2b | 106 | | PS.1st.d4
378
+ WS.106.3a | 106 | | PS.1st.d5
379
+ WS.106.3b | 106 | | PS.1st.d6
380
+ (42 rows)
381
+
382
+ insert into PLine values ('PL.001', '-0', 'Central call', 'PS.base.ta1');
383
+ insert into PLine values ('PL.002', '-101', '', 'PS.base.ta2');
384
+ insert into PLine values ('PL.003', '-102', '', 'PS.base.ta3');
385
+ insert into PLine values ('PL.004', '-103', '', 'PS.base.ta5');
386
+ insert into PLine values ('PL.005', '-104', '', 'PS.base.ta6');
387
+ insert into PLine values ('PL.006', '-106', '', 'PS.base.tb2');
388
+ insert into PLine values ('PL.007', '-108', '', 'PS.base.tb3');
389
+ insert into PLine values ('PL.008', '-109', '', 'PS.base.tb4');
390
+ insert into PLine values ('PL.009', '-121', '', 'PS.base.tb5');
391
+ insert into PLine values ('PL.010', '-122', '', 'PS.base.tb6');
392
+ insert into PLine values ('PL.015', '-134', '', 'PS.1st.ta1');
393
+ insert into PLine values ('PL.016', '-137', '', 'PS.1st.ta3');
394
+ insert into PLine values ('PL.017', '-139', '', 'PS.1st.ta4');
395
+ insert into PLine values ('PL.018', '-362', '', 'PS.1st.tb1');
396
+ insert into PLine values ('PL.019', '-363', '', 'PS.1st.tb2');
397
+ insert into PLine values ('PL.020', '-364', '', 'PS.1st.tb3');
398
+ insert into PLine values ('PL.021', '-365', '', 'PS.1st.tb5');
399
+ insert into PLine values ('PL.022', '-367', '', 'PS.1st.tb6');
400
+ insert into PLine values ('PL.028', '-501', 'Fax entrance', 'PS.base.ta2');
401
+ insert into PLine values ('PL.029', '-502', 'Fax 1st floor', 'PS.1st.ta1');
402
+ insert into PHone values ('PH.hc001', 'Hicom standard', 'WS.001.1a');
403
+ update PSlot set slotlink = 'PS.base.ta1' where slotname = 'PS.base.a1';
404
+ insert into PHone values ('PH.hc002', 'Hicom standard', 'WS.002.1a');
405
+ update PSlot set slotlink = 'PS.base.ta5' where slotname = 'PS.base.b1';
406
+ insert into PHone values ('PH.hc003', 'Hicom standard', 'WS.002.2a');
407
+ update PSlot set slotlink = 'PS.base.tb2' where slotname = 'PS.base.b3';
408
+ insert into PHone values ('PH.fax001', 'Canon fax', 'WS.001.2a');
409
+ update PSlot set slotlink = 'PS.base.ta2' where slotname = 'PS.base.a3';
410
+ insert into Hub values ('base.hub1', 'Patchfield PF0_1 hub', 16);
411
+ insert into System values ('orion', 'PC');
412
+ insert into IFace values ('IF', 'orion', 'eth0', 'WS.002.1b');
413
+ update PSlot set slotlink = 'HS.base.hub1.1' where slotname = 'PS.base.b2';
414
+ select * from PField_v1 where pfname = 'PF0_1' order by slotname;
415
+ pfname | slotname | backside | patch
416
+ --------+------------+----------------------------------------------------------+-----------------------------------------------
417
+ PF0_1 | PS.base.a1 | WS.001.1a in room 001 -> Phone PH.hc001 (Hicom standard) | PS.base.ta1 -> Phone line -0 (Central call)
418
+ PF0_1 | PS.base.a2 | WS.001.1b in room 001 -> - | -
419
+ PF0_1 | PS.base.a3 | WS.001.2a in room 001 -> Phone PH.fax001 (Canon fax) | PS.base.ta2 -> Phone line -501 (Fax entrance)
420
+ PF0_1 | PS.base.a4 | WS.001.2b in room 001 -> - | -
421
+ PF0_1 | PS.base.a5 | WS.001.3a in room 001 -> - | -
422
+ PF0_1 | PS.base.a6 | WS.001.3b in room 001 -> - | -
423
+ PF0_1 | PS.base.b1 | WS.002.1a in room 002 -> Phone PH.hc002 (Hicom standard) | PS.base.ta5 -> Phone line -103
424
+ PF0_1 | PS.base.b2 | WS.002.1b in room 002 -> orion IF eth0 (PC) | Patchfield PF0_1 hub slot 1
425
+ PF0_1 | PS.base.b3 | WS.002.2a in room 002 -> Phone PH.hc003 (Hicom standard) | PS.base.tb2 -> Phone line -106
426
+ PF0_1 | PS.base.b4 | WS.002.2b in room 002 -> - | -
427
+ PF0_1 | PS.base.b5 | WS.002.3a in room 002 -> - | -
428
+ PF0_1 | PS.base.b6 | WS.002.3b in room 002 -> - | -
429
+ PF0_1 | PS.base.c1 | WS.003.1a in room 003 -> - | -
430
+ PF0_1 | PS.base.c2 | WS.003.1b in room 003 -> - | -
431
+ PF0_1 | PS.base.c3 | WS.003.2a in room 003 -> - | -
432
+ PF0_1 | PS.base.c4 | WS.003.2b in room 003 -> - | -
433
+ PF0_1 | PS.base.c5 | WS.003.3a in room 003 -> - | -
434
+ PF0_1 | PS.base.c6 | WS.003.3b in room 003 -> - | -
435
+ (18 rows)
436
+
437
+ select * from PField_v1 where pfname = 'PF0_2' order by slotname;
438
+ pfname | slotname | backside | patch
439
+ --------+-------------+--------------------------------+------------------------------------------------------------------------
440
+ PF0_2 | PS.base.ta1 | Phone line -0 (Central call) | PS.base.a1 -> WS.001.1a in room 001 -> Phone PH.hc001 (Hicom standard)
441
+ PF0_2 | PS.base.ta2 | Phone line -501 (Fax entrance) | PS.base.a3 -> WS.001.2a in room 001 -> Phone PH.fax001 (Canon fax)
442
+ PF0_2 | PS.base.ta3 | Phone line -102 | -
443
+ PF0_2 | PS.base.ta4 | - | -
444
+ PF0_2 | PS.base.ta5 | Phone line -103 | PS.base.b1 -> WS.002.1a in room 002 -> Phone PH.hc002 (Hicom standard)
445
+ PF0_2 | PS.base.ta6 | Phone line -104 | -
446
+ PF0_2 | PS.base.tb1 | - | -
447
+ PF0_2 | PS.base.tb2 | Phone line -106 | PS.base.b3 -> WS.002.2a in room 002 -> Phone PH.hc003 (Hicom standard)
448
+ PF0_2 | PS.base.tb3 | Phone line -108 | -
449
+ PF0_2 | PS.base.tb4 | Phone line -109 | -
450
+ PF0_2 | PS.base.tb5 | Phone line -121 | -
451
+ PF0_2 | PS.base.tb6 | Phone line -122 | -
452
+ (12 rows)
453
+
454
+ insert into PField values ('PF1_1', 'should fail due to unique index');
455
+ ERROR: duplicate key violates unique constraint "pfield_name"
456
+ update PSlot set backlink = 'WS.not.there' where slotname = 'PS.base.a1';
457
+ ERROR: WS.not.there does not exist in WSlot
458
+ update PSlot set backlink = 'XX.illegal' where slotname = 'PS.base.a1';
459
+ ERROR: illegal backlink beginning with XX
460
+ update PSlot set slotlink = 'PS.not.there' where slotname = 'PS.base.a1';
461
+ ERROR: undefined method `stlotlink_unset' for PLtemp:Module
462
+ update PSlot set slotlink = 'XX.illegal' where slotname = 'PS.base.a1';
463
+ ERROR: undefined method `stlotlink_unset' for PLtemp:Module
464
+ insert into HSlot values ('HS', 'base.hub1', 1, '');
465
+ ERROR: duplicate key violates unique constraint "hslot_name"
466
+ insert into HSlot values ('HS', 'base.hub1', 20, '');
467
+ ERROR: no manual manipulation of HSlot
468
+ delete from HSlot;
469
+ ERROR: no manual manipulation of HSlot
470
+ insert into IFace values ('IF', 'notthere', 'eth0', '');
471
+ insert into IFace values ('IF', 'orion', 'ethernet_interface_name_too_long', '');
472
+ ERROR: IFace slotname IF.orion.ethernet_interface_name_too_long too long (20 char max)