cms icon indicating copy to clipboard operation
cms copied to clipboard

AWS: do not depend on ordering of `UNION ALL`

Open pobrn opened this issue 1 year ago • 3 comments

Apparently neither postgres nor the SQL standard guarantees that the order of the results will match the order the of the queries0.

If the results are not returned in order, then AWS will confuse which result belongs to which query, producing incomprehensible results on the admin page.

pobrn avatar Sep 11 '23 12:09 pobrn

~~I suppose queries could be converted to be just a simple list now, but I have not tested that at all.~~

EDIT: done, tested a bit.

pobrn avatar Sep 11 '23 12:09 pobrn

Hi @pobrn, thanks for the PR. I wonder if this is similar to what was implemented in #1201?

wil93 avatar Sep 12 '23 15:09 wil93

You're right. The linked PR seems to fix the same issue. In any case, it would good to merge either one because this came up during IOI2023 so a fix would be appreciated.

Please do note that the linked PR uses add_column, which appears to be deprecated.

pobrn avatar Sep 12 '23 22:09 pobrn