Harald Fuchs <hari(dot)fuchs(at)gmail(dot)com> writes:
> Apparently the CASE expression is named "adr" unless named
> otherwise, and the result set is sorted by this expression instead of
> the column named "adr". Does anyone know what the SQL standard says
> about that?
The SQL standard says the default name for any output column other
than a simple column reference is implementation-dependent. I think
our implementation involves looking at the default value for a CASE.
regards, tom lane