pgsql: Fix deparsing of Consts in postgres_fdw ORDER BY

2024-03-10 Thread David Rowley
Fix deparsing of Consts in postgres_fdw ORDER BY For UNION ALL queries where a union child query contained a foreign table, if the targetlist of that query contained a constant, and the top-level query performed an ORDER BY which contained the column for the constant value, then postgres_fdw would

pgsql: Fix deparsing of Consts in postgres_fdw ORDER BY

2024-03-10 Thread David Rowley
Fix deparsing of Consts in postgres_fdw ORDER BY For UNION ALL queries where a union child query contained a foreign table, if the targetlist of that query contained a constant, and the top-level query performed an ORDER BY which contained the column for the constant value, then postgres_fdw would

pgsql: Fix deparsing of Consts in postgres_fdw ORDER BY

2024-03-10 Thread David Rowley
Fix deparsing of Consts in postgres_fdw ORDER BY For UNION ALL queries where a union child query contained a foreign table, if the targetlist of that query contained a constant, and the top-level query performed an ORDER BY which contained the column for the constant value, then postgres_fdw would

pgsql: Fix deparsing of Consts in postgres_fdw ORDER BY

2024-03-10 Thread David Rowley
Fix deparsing of Consts in postgres_fdw ORDER BY For UNION ALL queries where a union child query contained a foreign table, if the targetlist of that query contained a constant, and the top-level query performed an ORDER BY which contained the column for the constant value, then postgres_fdw would

pgsql: Fix deparsing of Consts in postgres_fdw ORDER BY

2024-03-10 Thread David Rowley
Fix deparsing of Consts in postgres_fdw ORDER BY For UNION ALL queries where a union child query contained a foreign table, if the targetlist of that query contained a constant, and the top-level query performed an ORDER BY which contained the column for the constant value, then postgres_fdw would

pgsql: Fix deparsing of Consts in postgres_fdw ORDER BY

2024-03-10 Thread David Rowley
Fix deparsing of Consts in postgres_fdw ORDER BY For UNION ALL queries where a union child query contained a foreign table, if the targetlist of that query contained a constant, and the top-level query performed an ORDER BY which contained the column for the constant value, then postgres_fdw would