Dynamic Column Label in Postgres 9.5
How to derive a column name in the return type from input parameters to the function?


The short answer: Not possible.
SQL is very rigid about column data types and names. Those have to be declared before or at call time at the latest. No exceptions. No truly dynamic column names.

For a couple of possible workarounds see the answer to the duplicate question on SO:


How to derive a column name in the return type from input parameters to the function?