How to set/get a field of a nested composite type variable? For example:

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);


Now, how can I do the following for a variable x of type t3:

x.a.a.c := true;
y := x.a.a.c;


The first gives me an error.
There's one (awful, in my opinion) workaround... you can access only one level down at a time. Use intermediate variables.

DO LANGUAGE PLPGSQL
$$
DECLARE 
    x t3 ;
    x2 t2 ;
    x1 t1 ;
BEGIN
    -- x.a.a.c := true;   -- Syntax error

    x2 := x.a ;
    x1 := x2.a ;
    x1.c := true ;
    x2.a := x1 ;
    x.a := x2 ;
END ;
$$


dbfiddle here