You can access the values of a composite types alias by first writing it in parenthesis in the WHERE clause followed by one of its fields. For example:
SELECT (p).age, (p).name FROM test
When you then want to access it through a ResultSet, you can do it by referencing only the field:
rs.getInt("age");