v.22.2Improvement

Add PostgreSQL-style cast operator with array and tuple indexing support

Add ability to compose PostgreSQL-style cast operator :: with expressions using [] and . operators (array and tuple indexing). #34229 (Nikolay Degterinsky).
Added support for combining the PostgreSQL-style cast operator :: with expressions using [] (array indexing) and . (tuple indexing) operators.

Why it matters

This feature enables more flexible and concise type casting on complex expressions involving arrays and tuples, allowing users to write clearer and more expressive queries when working with nested data structures.

How to use it

Users can apply the PostgreSQL-style cast operator by appending ::Type to expressions that include [] or . indexing, for example:

SELECT (my_array[1])::UInt32, (my_tuple.element)::String FROM my_table;