{2,2} | {{a,b},{c,d},{e,f}}
{2,2} | {{a},{c}}
{{2,2},{2,2}} | {{a,b}}
- | {{a,b,c},{d,e,f}}
{11,NULL,22} |
+ | {{a,b,c},{d,e,f}}
(6 rows)
select testint4arr[1], testchar4arr[2:2] from domarrtest order by 1, 2;
2 | {{c}}
2 | {{c,d}}
2 | {{c,d}}
+ 11 |
| {}
| {{d,e,f}}
- 11 |
(6 rows)
select array_dims(testint4arr), array_dims(testchar4arr) from domarrtest order by 1, 2;
[1:2] | [1:2][1:2]
[1:2] | [1:3][1:2]
[1:2][1:2] | [1:1][1:2]
- | [1:2][1:3]
[1:3] |
+ | [1:2][1:3]
(6 rows)
COPY domarrtest FROM stdin;
testint4arr[1] = testint4arr[1] + 1,
testint4arr[3] = testint4arr[3] - 1
where testchar4arr is null;
-select * from domarrtest where testchar4arr is null;
+select * from domarrtest where testchar4arr is null order by 1;
testint4arr | testchar4arr
------------------+--------------
{12,NULL,21} |
explain (verbose, costs off)
update dcomptable set d1[1].r = d1[1].r - 1, d1[1].i = d1[1].i + 1
where d1[1].i > 0;
- QUERY PLAN
-----------------------------------------------------------------------------------------------------------------
- Update on public.dcomptable
- -> Seq Scan on public.dcomptable
- Output: (d1[1].r := (d1[1].r - '1'::double precision))[1].i := (d1[1].i + '1'::double precision), ctid
- Filter: (dcomptable.d1[1].i > '0'::double precision)
-(4 rows)
+ QUERY PLAN
+--------------------------------------------------------------------------------------------------------------------------
+ Remote Subquery Scan on any (datanode_1,datanode_2)
+ -> Update on public.dcomptable
+ -> Seq Scan on public.dcomptable
+ Output: (d1[1].r := (d1[1].r - '1'::double precision))[1].i := (d1[1].i + '1'::double precision), d1, ctid
+ Filter: (dcomptable.d1[1].i > '0'::double precision)
+(5 rows)
create rule silly as on delete to dcomptable do instead
update dcomptable set d1[1].r = d1[1].r - 1, d1[1].i = d1[1].i + 1
silly AS
ON DELETE TO dcomptable DO INSTEAD UPDATE dcomptable SET d1[1].r = dcomptable.d1[1].r - 1::double precision, d1[1].i = dcomptable.d1[1].i + 1::double precision
WHERE dcomptable.d1[1].i > 0::double precision
+Distribute By: REPLICATION
+Location Nodes: ALL DATANODES
drop table dcomptable;
drop type comptype cascade;