Why is 'use_alias' hardcoded to true in deparseFromExprForRel() for some cases

2024-07-16 Thread Rajan Pandey
Hi everyone, In the postgrs_fdw deparser code, deparseFromExprForRel() appends an alias to the remote query based on the 'use_alias' boolean flag. For a simple query, 'use_alias' is determined by `bms_membership(scanrel->relids) == BMS_MULTIPLE` condition. Example: https://github.com/postgres/post

Re: Why is 'use_alias' hardcoded to true in deparseFromExprForRel() for some cases

2024-07-16 Thread Tom Lane
Rajan Pandey writes: > This seems like an extra-protection in case of joins. But it could happen > that the join is across 2 different foreign postgres-servers (means each > foreign server will do SCAN only, and the JOIN will happen at the upper > layer). In that case, using aliases in the remote