The return type of array_agg() is declared as a `Sequence[T]` where `T`
is bound to the type of input argument.
This is implemented by making array_agg() inheriting from
ReturnTypeFromArgs which provides appropriate overloads of `__init__()`
to support this.
This usage of ReturnTypeFromArgs is a bit different from previous ones
as the return type of the function is not exactly the same as that of
its arguments, but a "collection" (a generic, namely a Sequence here) of
the argument types. Accordingly, we adjust the code of
tools/generate_sql_functions.py to retrieve the "collection" type
from 'fn_class' annotation and generate expected return type
accordingly.
Also add a couple of hand-written typing tests for PostgreSQL.