That link does not say it is possible at all, it offers a workaround by
using a Common Table Expresion (CTE) for the projection, and then use
that CTE in another select so you can use the column name (alias)
defined in the CTE. The same can also be achieved with an inline derived
table.
So, solution with CTE:
with res as (
SELECT EXECUTER_ACTION_RESULT_ID, STATUS AS RES_STATUS
FROM EXECUTER_ACTIONS_RESULTS
)
select *
from res
where RES_STATUS like '%C%'
order by 1 asc
or with an inline derived table:
select *
from (
SELECT EXECUTER_ACTION_RESULT_ID, STATUS AS RES_STATUS
FROM EXECUTER_ACTIONS_RESULTS
) res
where RES_STATUS like '%C%'
order by 1 asc
That is not related to column alias, nor usage in a WHERE clause. It was
a bug where explicitly referencing the table was required where it
shouldn't be necessary because the column reference was not ambiguous.
That said, you can uses aliases in the RETURNING clause, but that just
defines the names of the output columns of RETURNING (similar to what
happens in a SELECT), and is also not related to what you're trying to
do.
Mark