Re: UNION ALL: Apparently based on column order rather than on column name or alias

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Schmid <user462411(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: UNION ALL: Apparently based on column order rather than on column name or alias
Date: 2018-12-06 15:06:24
Message-ID: 13386.1544108784@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andreas Schmid <user462411(at)gmail(dot)com> writes:
> So my conclusion is that the result of UNION ALL depends on the column
> order, not on the column names or aliases. Is this the intended
> behaviour?

Yes, this is required by SQL spec. Matching by column name would
be used if you wrote a CORRESPONDING clause, but we don't implement
that feature.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2018-12-06 15:19:23 Re: order of reading the conf files
Previous Message Stephen Frost 2018-12-06 14:52:30 Re: order of reading the conf files