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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rajan Pandey <rajanpandey2508(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Why is 'use_alias' hardcoded to true in deparseFromExprForRel() for some cases
Date: 2024-07-16 12:40:47
Message-ID: 3318732.1721133647@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Rajan Pandey <rajanpandey2508(at)gmail(dot)com> 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 queries seem redundant to
> me.
> Please correct me if I am missing something. Can we note pass
> `bms_membership(foreignrel->relids) == BMS_MULTIPLE` instead?

I'd be very very careful about changing that, because presence
of a join alias affects the parser's behavior in non-obvious ways.
Unless you've got some compellingly good reason for messing
with this, I doubt it is worth the investigatory effort to
convince ourselves that it wouldn't introduce any bugs.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2024-07-16 12:52:51 Re: Compress ReorderBuffer spill files using LZ4
Previous Message Joe Conway 2024-07-16 12:28:09 Re: CI, macports, darwin version problems