clear markdown compare help donate or buy diddy dollings comments/suggestions/bugs a leap of faith? bible365
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 648607 fiddles created (15331 in the last week).

create type t1 as (a int2, b text, c boolean); create type t2 as (a t1, b boolean); create type t3 as (a t2, b int4);
 hidden batch(es)


-- Now, how can I do the following for a variable x of type t3: DO LANGUAGE PLPGSQL $$ DECLARE x t3 ; y boolean ; z t3 ; BEGIN z := x ; -- Works x.a.a.c := true; -- Syntax error y := x.a.a.c; END ; $$
ERROR: syntax error at or near "x" LINE 11: x.a.a.c := true; -- Syntax error ^
 hidden batch(es)


DO LANGUAGE PLPGSQL $$ DECLARE x t3 ; z t3 ; BEGIN x.a := z.a ; END ; $$
 hidden batch(es)


DO LANGUAGE PLPGSQL $$ DECLARE x t3 ; z t3 ; BEGIN x.a.a := z.a.a ; END ; $$
ERROR: "x.a.a" is not a known variable LINE 7: x.a.a := z.a.a ; ^
 hidden batch(es)


DO LANGUAGE PLPGSQL $$ DECLARE x t3 ; z t3 ; BEGIN (x.a).a := z.a.a ; END ; $$
ERROR: syntax error at or near "(" LINE 7: (x.a).a := z.a.a ; ^
 hidden batch(es)