... btw, a little digging shows that this ordering is required by the SQL standard. The least excruciating version of the relevant text is in SQL92 7.5 <joined table>:
d) Let SLCC be a <select list> of <derived column>s of the form COALESCE ( TA.C, TB.C ) AS C for every column C that is a corresponding join column, taken in order of their ordinal positions in T1. e) Let SL1 be a <select list> of those <column name>s of T1 that are not corresponding join columns, taken in order of their ordinal positions in T1, and let SLT2 be a <select list> of those <column name>s of T2 that are not correspond- ing join columns, taken in order of their ordinal positions in T2. f) The descriptors of the columns of the result of the <joined table> are the same as the descriptors of the columns of the result of SELECT SLCC, SLT1, SLT2 FROM TR1, TR2 Later versions of the standard use many more words to say the same thing. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general