~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/test/regress/expected/polymorphism.out

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- Currently this tests polymorphic aggregates and indirectly does some
 
2
-- testing of polymorphic SQL functions.  It ought to be extended.
 
3
-- Legend:
 
4
-----------
 
5
-- A = type is ANY
 
6
-- P = type is polymorphic
 
7
-- N = type is non-polymorphic
 
8
-- B = aggregate base type
 
9
-- S = aggregate state type
 
10
-- R = aggregate return type
 
11
-- 1 = arg1 of a function
 
12
-- 2 = arg2 of a function
 
13
-- ag = aggregate
 
14
-- tf = trans (state) function
 
15
-- ff = final function
 
16
-- rt = return type of a function
 
17
-- -> = implies
 
18
-- => = allowed
 
19
-- !> = not allowed
 
20
-- E  = exists
 
21
-- NE = not-exists
 
22
-- 
 
23
-- Possible states:
 
24
-- ----------------
 
25
-- B = (A || P || N)
 
26
--   when (B = A) -> (tf2 = NE)
 
27
-- S = (P || N)
 
28
-- ff = (E || NE)
 
29
-- tf1 = (P || N)
 
30
-- tf2 = (NE || P || N)
 
31
-- R = (P || N)
 
32
-- create functions for use as tf and ff with the needed combinations of
 
33
-- argument polymorphism, but within the constraints of valid aggregate
 
34
-- functions, i.e. tf arg1 and tf return type must match
 
35
-- polymorphic single arg transfn
 
36
CREATE FUNCTION stfp(anyarray) returns anyarray as
 
37
'select $1' language 'sql';
 
38
-- non-polymorphic single arg transfn
 
39
CREATE FUNCTION stfnp(int[]) returns int[] as
 
40
'select $1' language 'sql';
 
41
-- dual polymorphic transfn
 
42
CREATE FUNCTION tfp(anyarray,anyelement) returns anyarray as
 
43
'select $1 || $2' language 'sql';
 
44
-- dual non-polymorphic transfn
 
45
CREATE FUNCTION tfnp(int[],int) returns int[] as
 
46
'select $1 || $2' language 'sql';
 
47
-- arg1 only polymorphic transfn
 
48
CREATE FUNCTION tf1p(anyarray,int) returns anyarray as
 
49
'select $1' language 'sql';
 
50
-- arg2 only polymorphic transfn
 
51
CREATE FUNCTION tf2p(int[],anyelement) returns int[] as
 
52
'select $1' language 'sql';
 
53
-- finalfn polymorphic
 
54
CREATE FUNCTION ffp(anyarray) returns anyarray as
 
55
'select $1' language 'sql';
 
56
-- finalfn non-polymorphic
 
57
CREATE FUNCTION ffnp(int[]) returns int[] as
 
58
'select $1' language 'sql';
 
59
-- Try to cover all the possible states:
 
60
-- 
 
61
-- Note: in Cases 1 & 2, we are trying to return P. Therefore, if the transfn
 
62
-- is stfnp, tfnp, or tf2p, we must use ffp as finalfn, because stfnp, tfnp,
 
63
-- and tf2p do not return P. Conversely, in Cases 3 & 4, we are trying to
 
64
-- return N. Therefore, if the transfn is stfp, tfp, or tf1p, we must use ffnp
 
65
-- as finalfn, because stfp, tfp, and tf1p do not return N.
 
66
--
 
67
--     Case1 (R = P) && (B = A)
 
68
--     ------------------------
 
69
--     S    tf1
 
70
--     -------
 
71
--     N    N
 
72
-- should CREATE
 
73
CREATE AGGREGATE myaggp01a(BASETYPE = "ANY", SFUNC = stfnp, STYPE = int4[],
 
74
  FINALFUNC = ffp, INITCOND = '{}');
 
75
--     P    N
 
76
-- should ERROR: stfnp(anyarray) not matched by stfnp(int[])
 
77
CREATE AGGREGATE myaggp02a(BASETYPE = "ANY", SFUNC = stfnp, STYPE = anyarray,
 
78
  FINALFUNC = ffp, INITCOND = '{}');
 
79
ERROR:  cannot determine transition data type
 
80
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
81
--     N    P
 
82
-- should CREATE
 
83
CREATE AGGREGATE myaggp03a(BASETYPE = "ANY", SFUNC = stfp, STYPE = int4[],
 
84
  FINALFUNC = ffp, INITCOND = '{}');
 
85
CREATE AGGREGATE myaggp03b(BASETYPE = "ANY", SFUNC = stfp, STYPE = int4[],
 
86
  INITCOND = '{}');
 
87
--     P    P
 
88
-- should ERROR: we have no way to resolve S
 
89
CREATE AGGREGATE myaggp04a(BASETYPE = "ANY", SFUNC = stfp, STYPE = anyarray,
 
90
  FINALFUNC = ffp, INITCOND = '{}');
 
91
ERROR:  cannot determine transition data type
 
92
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
93
CREATE AGGREGATE myaggp04b(BASETYPE = "ANY", SFUNC = stfp, STYPE = anyarray,
 
94
  INITCOND = '{}');
 
95
ERROR:  cannot determine transition data type
 
96
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
97
--    Case2 (R = P) && ((B = P) || (B = N))
 
98
--    -------------------------------------
 
99
--    S    tf1      B    tf2
 
100
--    -----------------------
 
101
--    N    N        N    N
 
102
-- should CREATE
 
103
CREATE AGGREGATE myaggp05a(BASETYPE = int, SFUNC = tfnp, STYPE = int[],
 
104
  FINALFUNC = ffp, INITCOND = '{}');
 
105
--    N    N        N    P
 
106
-- should CREATE
 
107
CREATE AGGREGATE myaggp06a(BASETYPE = int, SFUNC = tf2p, STYPE = int[],
 
108
  FINALFUNC = ffp, INITCOND = '{}');
 
109
--    N    N        P    N
 
110
-- should ERROR: tfnp(int[], anyelement) not matched by tfnp(int[], int)
 
111
CREATE AGGREGATE myaggp07a(BASETYPE = anyelement, SFUNC = tfnp, STYPE = int[],
 
112
  FINALFUNC = ffp, INITCOND = '{}');
 
113
ERROR:  function tfnp(integer[], anyelement) does not exist
 
114
--    N    N        P    P
 
115
-- should CREATE
 
116
CREATE AGGREGATE myaggp08a(BASETYPE = anyelement, SFUNC = tf2p, STYPE = int[],
 
117
  FINALFUNC = ffp, INITCOND = '{}');
 
118
--    N    P        N    N
 
119
-- should CREATE
 
120
CREATE AGGREGATE myaggp09a(BASETYPE = int, SFUNC = tf1p, STYPE = int[],
 
121
  FINALFUNC = ffp, INITCOND = '{}');
 
122
CREATE AGGREGATE myaggp09b(BASETYPE = int, SFUNC = tf1p, STYPE = int[],
 
123
  INITCOND = '{}');
 
124
--    N    P        N    P
 
125
-- should CREATE
 
126
CREATE AGGREGATE myaggp10a(BASETYPE = int, SFUNC = tfp, STYPE = int[],
 
127
  FINALFUNC = ffp, INITCOND = '{}');
 
128
CREATE AGGREGATE myaggp10b(BASETYPE = int, SFUNC = tfp, STYPE = int[],
 
129
  INITCOND = '{}');
 
130
--    N    P        P    N
 
131
-- should ERROR: tf1p(int[],anyelement) not matched by tf1p(anyarray,int)
 
132
CREATE AGGREGATE myaggp11a(BASETYPE = anyelement, SFUNC = tf1p, STYPE = int[],
 
133
  FINALFUNC = ffp, INITCOND = '{}');
 
134
ERROR:  function tf1p(integer[], anyelement) does not exist
 
135
CREATE AGGREGATE myaggp11b(BASETYPE = anyelement, SFUNC = tf1p, STYPE = int[],
 
136
  INITCOND = '{}');
 
137
ERROR:  function tf1p(integer[], anyelement) does not exist
 
138
--    N    P        P    P
 
139
-- should ERROR: tfp(int[],anyelement) not matched by tfp(anyarray,anyelement)
 
140
CREATE AGGREGATE myaggp12a(BASETYPE = anyelement, SFUNC = tfp, STYPE = int[],
 
141
  FINALFUNC = ffp, INITCOND = '{}');
 
142
ERROR:  function tfp(integer[], anyelement) does not exist
 
143
CREATE AGGREGATE myaggp12b(BASETYPE = anyelement, SFUNC = tfp, STYPE = int[],
 
144
  INITCOND = '{}');
 
145
ERROR:  function tfp(integer[], anyelement) does not exist
 
146
--    P    N        N    N
 
147
-- should ERROR: tfnp(anyarray, int) not matched by tfnp(int[],int)
 
148
CREATE AGGREGATE myaggp13a(BASETYPE = int, SFUNC = tfnp, STYPE = anyarray,
 
149
  FINALFUNC = ffp, INITCOND = '{}');
 
150
ERROR:  cannot determine transition data type
 
151
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
152
--    P    N        N    P
 
153
-- should ERROR: tf2p(anyarray, int) not matched by tf2p(int[],anyelement)
 
154
CREATE AGGREGATE myaggp14a(BASETYPE = int, SFUNC = tf2p, STYPE = anyarray,
 
155
  FINALFUNC = ffp, INITCOND = '{}');
 
156
ERROR:  cannot determine transition data type
 
157
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
158
--    P    N        P    N
 
159
-- should ERROR: tfnp(anyarray, anyelement) not matched by tfnp(int[],int)
 
160
CREATE AGGREGATE myaggp15a(BASETYPE = anyelement, SFUNC = tfnp,
 
161
  STYPE = anyarray, FINALFUNC = ffp, INITCOND = '{}');
 
162
ERROR:  function tfnp(anyarray, anyelement) does not exist
 
163
--    P    N        P    P
 
164
-- should ERROR: tf2p(anyarray, anyelement) not matched by tf2p(int[],anyelement)
 
165
CREATE AGGREGATE myaggp16a(BASETYPE = anyelement, SFUNC = tf2p,
 
166
  STYPE = anyarray, FINALFUNC = ffp, INITCOND = '{}');
 
167
ERROR:  function tf2p(anyarray, anyelement) does not exist
 
168
--    P    P        N    N
 
169
-- should ERROR: we have no way to resolve S
 
170
CREATE AGGREGATE myaggp17a(BASETYPE = int, SFUNC = tf1p, STYPE = anyarray,
 
171
  FINALFUNC = ffp, INITCOND = '{}');
 
172
ERROR:  cannot determine transition data type
 
173
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
174
CREATE AGGREGATE myaggp17b(BASETYPE = int, SFUNC = tf1p, STYPE = anyarray,
 
175
  INITCOND = '{}');
 
176
ERROR:  cannot determine transition data type
 
177
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
178
--    P    P        N    P
 
179
-- should ERROR: tfp(anyarray, int) not matched by tfp(anyarray, anyelement)
 
180
CREATE AGGREGATE myaggp18a(BASETYPE = int, SFUNC = tfp, STYPE = anyarray,
 
181
  FINALFUNC = ffp, INITCOND = '{}');
 
182
ERROR:  cannot determine transition data type
 
183
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
184
CREATE AGGREGATE myaggp18b(BASETYPE = int, SFUNC = tfp, STYPE = anyarray,
 
185
  INITCOND = '{}');
 
186
ERROR:  cannot determine transition data type
 
187
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
188
--    P    P        P    N
 
189
-- should ERROR: tf1p(anyarray, anyelement) not matched by tf1p(anyarray, int)
 
190
CREATE AGGREGATE myaggp19a(BASETYPE = anyelement, SFUNC = tf1p,
 
191
  STYPE = anyarray, FINALFUNC = ffp, INITCOND = '{}');
 
192
ERROR:  function tf1p(anyarray, anyelement) does not exist
 
193
CREATE AGGREGATE myaggp19b(BASETYPE = anyelement, SFUNC = tf1p,
 
194
  STYPE = anyarray, INITCOND = '{}');
 
195
ERROR:  function tf1p(anyarray, anyelement) does not exist
 
196
--    P    P        P    P
 
197
-- should CREATE
 
198
CREATE AGGREGATE myaggp20a(BASETYPE = anyelement, SFUNC = tfp,
 
199
  STYPE = anyarray, FINALFUNC = ffp, INITCOND = '{}');
 
200
CREATE AGGREGATE myaggp20b(BASETYPE = anyelement, SFUNC = tfp,
 
201
  STYPE = anyarray, INITCOND = '{}');
 
202
--     Case3 (R = N) && (B = A)
 
203
--     ------------------------
 
204
--     S    tf1
 
205
--     -------
 
206
--     N    N
 
207
-- should CREATE
 
208
CREATE AGGREGATE myaggn01a(BASETYPE = "ANY", SFUNC = stfnp, STYPE = int4[],
 
209
  FINALFUNC = ffnp, INITCOND = '{}');
 
210
CREATE AGGREGATE myaggn01b(BASETYPE = "ANY", SFUNC = stfnp, STYPE = int4[],
 
211
  INITCOND = '{}');
 
212
--     P    N
 
213
-- should ERROR: stfnp(anyarray) not matched by stfnp(int[])
 
214
CREATE AGGREGATE myaggn02a(BASETYPE = "ANY", SFUNC = stfnp, STYPE = anyarray,
 
215
  FINALFUNC = ffnp, INITCOND = '{}');
 
216
ERROR:  cannot determine transition data type
 
217
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
218
CREATE AGGREGATE myaggn02b(BASETYPE = "ANY", SFUNC = stfnp, STYPE = anyarray,
 
219
  INITCOND = '{}');
 
220
ERROR:  cannot determine transition data type
 
221
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
222
--     N    P
 
223
-- should CREATE
 
224
CREATE AGGREGATE myaggn03a(BASETYPE = "ANY", SFUNC = stfp, STYPE = int4[],
 
225
  FINALFUNC = ffnp, INITCOND = '{}');
 
226
--     P    P
 
227
-- should ERROR: ffnp(anyarray) not matched by ffnp(int[])
 
228
CREATE AGGREGATE myaggn04a(BASETYPE = "ANY", SFUNC = stfp, STYPE = anyarray,
 
229
  FINALFUNC = ffnp, INITCOND = '{}');
 
230
ERROR:  cannot determine transition data type
 
231
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
232
--    Case4 (R = N) && ((B = P) || (B = N))
 
233
--    -------------------------------------
 
234
--    S    tf1      B    tf2
 
235
--    -----------------------
 
236
--    N    N        N    N
 
237
-- should CREATE
 
238
CREATE AGGREGATE myaggn05a(BASETYPE = int, SFUNC = tfnp, STYPE = int[],
 
239
  FINALFUNC = ffnp, INITCOND = '{}');
 
240
CREATE AGGREGATE myaggn05b(BASETYPE = int, SFUNC = tfnp, STYPE = int[],
 
241
  INITCOND = '{}');
 
242
--    N    N        N    P
 
243
-- should CREATE
 
244
CREATE AGGREGATE myaggn06a(BASETYPE = int, SFUNC = tf2p, STYPE = int[],
 
245
  FINALFUNC = ffnp, INITCOND = '{}');
 
246
CREATE AGGREGATE myaggn06b(BASETYPE = int, SFUNC = tf2p, STYPE = int[],
 
247
  INITCOND = '{}');
 
248
--    N    N        P    N
 
249
-- should ERROR: tfnp(int[], anyelement) not matched by tfnp(int[], int)
 
250
CREATE AGGREGATE myaggn07a(BASETYPE = anyelement, SFUNC = tfnp, STYPE = int[],
 
251
  FINALFUNC = ffnp, INITCOND = '{}');
 
252
ERROR:  function tfnp(integer[], anyelement) does not exist
 
253
CREATE AGGREGATE myaggn07b(BASETYPE = anyelement, SFUNC = tfnp, STYPE = int[],
 
254
  INITCOND = '{}');
 
255
ERROR:  function tfnp(integer[], anyelement) does not exist
 
256
--    N    N        P    P
 
257
-- should CREATE
 
258
CREATE AGGREGATE myaggn08a(BASETYPE = anyelement, SFUNC = tf2p, STYPE = int[],
 
259
  FINALFUNC = ffnp, INITCOND = '{}');
 
260
CREATE AGGREGATE myaggn08b(BASETYPE = anyelement, SFUNC = tf2p, STYPE = int[],
 
261
  INITCOND = '{}');
 
262
--    N    P        N    N
 
263
-- should CREATE
 
264
CREATE AGGREGATE myaggn09a(BASETYPE = int, SFUNC = tf1p, STYPE = int[],
 
265
  FINALFUNC = ffnp, INITCOND = '{}');
 
266
--    N    P        N    P
 
267
-- should CREATE
 
268
CREATE AGGREGATE myaggn10a(BASETYPE = int, SFUNC = tfp, STYPE = int[],
 
269
  FINALFUNC = ffnp, INITCOND = '{}');
 
270
--    N    P        P    N
 
271
-- should ERROR: tf1p(int[],anyelement) not matched by tf1p(anyarray,int)
 
272
CREATE AGGREGATE myaggn11a(BASETYPE = anyelement, SFUNC = tf1p, STYPE = int[],
 
273
  FINALFUNC = ffnp, INITCOND = '{}');
 
274
ERROR:  function tf1p(integer[], anyelement) does not exist
 
275
--    N    P        P    P
 
276
-- should ERROR: tfp(int[],anyelement) not matched by tfp(anyarray,anyelement)
 
277
CREATE AGGREGATE myaggn12a(BASETYPE = anyelement, SFUNC = tfp, STYPE = int[],
 
278
  FINALFUNC = ffnp, INITCOND = '{}');
 
279
ERROR:  function tfp(integer[], anyelement) does not exist
 
280
--    P    N        N    N
 
281
-- should ERROR: tfnp(anyarray, int) not matched by tfnp(int[],int)
 
282
CREATE AGGREGATE myaggn13a(BASETYPE = int, SFUNC = tfnp, STYPE = anyarray,
 
283
  FINALFUNC = ffnp, INITCOND = '{}');
 
284
ERROR:  cannot determine transition data type
 
285
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
286
CREATE AGGREGATE myaggn13b(BASETYPE = int, SFUNC = tfnp, STYPE = anyarray,
 
287
  INITCOND = '{}');
 
288
ERROR:  cannot determine transition data type
 
289
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
290
--    P    N        N    P
 
291
-- should ERROR: tf2p(anyarray, int) not matched by tf2p(int[],anyelement)
 
292
CREATE AGGREGATE myaggn14a(BASETYPE = int, SFUNC = tf2p, STYPE = anyarray,
 
293
  FINALFUNC = ffnp, INITCOND = '{}');
 
294
ERROR:  cannot determine transition data type
 
295
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
296
CREATE AGGREGATE myaggn14b(BASETYPE = int, SFUNC = tf2p, STYPE = anyarray,
 
297
  INITCOND = '{}');
 
298
ERROR:  cannot determine transition data type
 
299
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
300
--    P    N        P    N
 
301
-- should ERROR: tfnp(anyarray, anyelement) not matched by tfnp(int[],int)
 
302
CREATE AGGREGATE myaggn15a(BASETYPE = anyelement, SFUNC = tfnp,
 
303
  STYPE = anyarray, FINALFUNC = ffnp, INITCOND = '{}');
 
304
ERROR:  function tfnp(anyarray, anyelement) does not exist
 
305
CREATE AGGREGATE myaggn15b(BASETYPE = anyelement, SFUNC = tfnp,
 
306
  STYPE = anyarray, INITCOND = '{}');
 
307
ERROR:  function tfnp(anyarray, anyelement) does not exist
 
308
--    P    N        P    P
 
309
-- should ERROR: tf2p(anyarray, anyelement) not matched by tf2p(int[],anyelement)
 
310
CREATE AGGREGATE myaggn16a(BASETYPE = anyelement, SFUNC = tf2p,
 
311
  STYPE = anyarray, FINALFUNC = ffnp, INITCOND = '{}');
 
312
ERROR:  function tf2p(anyarray, anyelement) does not exist
 
313
CREATE AGGREGATE myaggn16b(BASETYPE = anyelement, SFUNC = tf2p,
 
314
  STYPE = anyarray, INITCOND = '{}');
 
315
ERROR:  function tf2p(anyarray, anyelement) does not exist
 
316
--    P    P        N    N
 
317
-- should ERROR: ffnp(anyarray) not matched by ffnp(int[])
 
318
CREATE AGGREGATE myaggn17a(BASETYPE = int, SFUNC = tf1p, STYPE = anyarray,
 
319
  FINALFUNC = ffnp, INITCOND = '{}');
 
320
ERROR:  cannot determine transition data type
 
321
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
322
--    P    P        N    P
 
323
-- should ERROR: tfp(anyarray, int) not matched by tfp(anyarray, anyelement)
 
324
CREATE AGGREGATE myaggn18a(BASETYPE = int, SFUNC = tfp, STYPE = anyarray,
 
325
  FINALFUNC = ffnp, INITCOND = '{}');
 
326
ERROR:  cannot determine transition data type
 
327
DETAIL:  An aggregate using "anyarray" or "anyelement" as transition type must have one of them as its base type.
 
328
--    P    P        P    N
 
329
-- should ERROR: tf1p(anyarray, anyelement) not matched by tf1p(anyarray, int)
 
330
CREATE AGGREGATE myaggn19a(BASETYPE = anyelement, SFUNC = tf1p,
 
331
  STYPE = anyarray, FINALFUNC = ffnp, INITCOND = '{}');
 
332
ERROR:  function tf1p(anyarray, anyelement) does not exist
 
333
--    P    P        P    P
 
334
-- should ERROR: ffnp(anyarray) not matched by ffnp(int[])
 
335
CREATE AGGREGATE myaggn20a(BASETYPE = anyelement, SFUNC = tfp,
 
336
  STYPE = anyarray, FINALFUNC = ffnp, INITCOND = '{}');
 
337
ERROR:  function ffnp(anyarray) does not exist
 
338
-- create test data for polymorphic aggregates
 
339
create temp table t(f1 int, f2 int[], f3 text);
 
340
insert into t values(1,array[1],'a');
 
341
insert into t values(1,array[11],'b');
 
342
insert into t values(1,array[111],'c');
 
343
insert into t values(2,array[2],'a');
 
344
insert into t values(2,array[22],'b');
 
345
insert into t values(2,array[222],'c');
 
346
insert into t values(3,array[3],'a');
 
347
insert into t values(3,array[3],'b');
 
348
-- test the successfully created polymorphic aggregates
 
349
select f3, myaggp01a(*) from t group by f3;
 
350
 f3 | myaggp01a 
 
351
----+-----------
 
352
 b  | {}
 
353
 c  | {}
 
354
 a  | {}
 
355
(3 rows)
 
356
 
 
357
select f3, myaggp03a(*) from t group by f3;
 
358
 f3 | myaggp03a 
 
359
----+-----------
 
360
 b  | {}
 
361
 c  | {}
 
362
 a  | {}
 
363
(3 rows)
 
364
 
 
365
select f3, myaggp03b(*) from t group by f3;
 
366
 f3 | myaggp03b 
 
367
----+-----------
 
368
 b  | {}
 
369
 c  | {}
 
370
 a  | {}
 
371
(3 rows)
 
372
 
 
373
select f3, myaggp05a(f1) from t group by f3;
 
374
 f3 | myaggp05a 
 
375
----+-----------
 
376
 b  | {1,2,3}
 
377
 c  | {1,2}
 
378
 a  | {1,2,3}
 
379
(3 rows)
 
380
 
 
381
select f3, myaggp06a(f1) from t group by f3;
 
382
 f3 | myaggp06a 
 
383
----+-----------
 
384
 b  | {}
 
385
 c  | {}
 
386
 a  | {}
 
387
(3 rows)
 
388
 
 
389
select f3, myaggp08a(f1) from t group by f3;
 
390
 f3 | myaggp08a 
 
391
----+-----------
 
392
 b  | {}
 
393
 c  | {}
 
394
 a  | {}
 
395
(3 rows)
 
396
 
 
397
select f3, myaggp09a(f1) from t group by f3;
 
398
 f3 | myaggp09a 
 
399
----+-----------
 
400
 b  | {}
 
401
 c  | {}
 
402
 a  | {}
 
403
(3 rows)
 
404
 
 
405
select f3, myaggp09b(f1) from t group by f3;
 
406
 f3 | myaggp09b 
 
407
----+-----------
 
408
 b  | {}
 
409
 c  | {}
 
410
 a  | {}
 
411
(3 rows)
 
412
 
 
413
select f3, myaggp10a(f1) from t group by f3;
 
414
 f3 | myaggp10a 
 
415
----+-----------
 
416
 b  | {1,2,3}
 
417
 c  | {1,2}
 
418
 a  | {1,2,3}
 
419
(3 rows)
 
420
 
 
421
select f3, myaggp10b(f1) from t group by f3;
 
422
 f3 | myaggp10b 
 
423
----+-----------
 
424
 b  | {1,2,3}
 
425
 c  | {1,2}
 
426
 a  | {1,2,3}
 
427
(3 rows)
 
428
 
 
429
select f3, myaggp20a(f1) from t group by f3;
 
430
 f3 | myaggp20a 
 
431
----+-----------
 
432
 b  | {1,2,3}
 
433
 c  | {1,2}
 
434
 a  | {1,2,3}
 
435
(3 rows)
 
436
 
 
437
select f3, myaggp20b(f1) from t group by f3;
 
438
 f3 | myaggp20b 
 
439
----+-----------
 
440
 b  | {1,2,3}
 
441
 c  | {1,2}
 
442
 a  | {1,2,3}
 
443
(3 rows)
 
444
 
 
445
select f3, myaggn01a(*) from t group by f3;
 
446
 f3 | myaggn01a 
 
447
----+-----------
 
448
 b  | {}
 
449
 c  | {}
 
450
 a  | {}
 
451
(3 rows)
 
452
 
 
453
select f3, myaggn01b(*) from t group by f3;
 
454
 f3 | myaggn01b 
 
455
----+-----------
 
456
 b  | {}
 
457
 c  | {}
 
458
 a  | {}
 
459
(3 rows)
 
460
 
 
461
select f3, myaggn03a(*) from t group by f3;
 
462
 f3 | myaggn03a 
 
463
----+-----------
 
464
 b  | {}
 
465
 c  | {}
 
466
 a  | {}
 
467
(3 rows)
 
468
 
 
469
select f3, myaggn05a(f1) from t group by f3;
 
470
 f3 | myaggn05a 
 
471
----+-----------
 
472
 b  | {1,2,3}
 
473
 c  | {1,2}
 
474
 a  | {1,2,3}
 
475
(3 rows)
 
476
 
 
477
select f3, myaggn05b(f1) from t group by f3;
 
478
 f3 | myaggn05b 
 
479
----+-----------
 
480
 b  | {1,2,3}
 
481
 c  | {1,2}
 
482
 a  | {1,2,3}
 
483
(3 rows)
 
484
 
 
485
select f3, myaggn06a(f1) from t group by f3;
 
486
 f3 | myaggn06a 
 
487
----+-----------
 
488
 b  | {}
 
489
 c  | {}
 
490
 a  | {}
 
491
(3 rows)
 
492
 
 
493
select f3, myaggn06b(f1) from t group by f3;
 
494
 f3 | myaggn06b 
 
495
----+-----------
 
496
 b  | {}
 
497
 c  | {}
 
498
 a  | {}
 
499
(3 rows)
 
500
 
 
501
select f3, myaggn08a(f1) from t group by f3;
 
502
 f3 | myaggn08a 
 
503
----+-----------
 
504
 b  | {}
 
505
 c  | {}
 
506
 a  | {}
 
507
(3 rows)
 
508
 
 
509
select f3, myaggn08b(f1) from t group by f3;
 
510
 f3 | myaggn08b 
 
511
----+-----------
 
512
 b  | {}
 
513
 c  | {}
 
514
 a  | {}
 
515
(3 rows)
 
516
 
 
517
select f3, myaggn09a(f1) from t group by f3;
 
518
 f3 | myaggn09a 
 
519
----+-----------
 
520
 b  | {}
 
521
 c  | {}
 
522
 a  | {}
 
523
(3 rows)
 
524
 
 
525
select f3, myaggn10a(f1) from t group by f3;
 
526
 f3 | myaggn10a 
 
527
----+-----------
 
528
 b  | {1,2,3}
 
529
 c  | {1,2}
 
530
 a  | {1,2,3}
 
531
(3 rows)
 
532