postgresql_16:3.1.2.4 Field Selection
PostgreSQL 16 > The SQL Language > SQL Syntax > Value Expressions > Field Selection
If an expression yields a value of a composite type (row type), then a specific field of the row can be extracted by writing *expression*.*fieldname*
In general the row *expression* must be parenthesized, but the parentheses can be omitted when the expression to be selected from is just a table reference or positional parameter. For example: mytable.mycolumn $1.somecolumn (rowfunction(a,b)).col3 (Thus, a qualified column reference is actually just a special case of the field selection syntax.) An important special case is extracting a field from a table column that is of a composite type: (compositecol).somefield (mytable.compositecol).somefield The parentheses are required here to show that compositecol is a column name not a table name, or that mytable is a table name not a schema name in the second case.
You can ask for all fields of a composite value by writing .*: (compositecol).* This notation behaves differently depending on context; see (see postgresql_16:3.5.16.5) for details.