pgsql: Remove assertion checking query ID in execMain.c

2024-10-03 Thread Michael Paquier
Remove assertion checking query ID in execMain.c This assertion has been added by 24f520594809, but Alexander Lakhin has proved that the ExecutorRun() one can be broken by using a PL function that manipulates compute_query_id and track_activities, while the ones in ExecutorFinish() and ExecutorEnd

pgsql: Refactor CopyFrom() in copyfrom.c.

2024-10-03 Thread Fujii Masao
Refactor CopyFrom() in copyfrom.c. This commit simplifies CopyFrom() by removing the unnecessary local variable 'skipped', which tracked the number of rows skipped due to on_error = 'ignore'. That count is already handled by cstate->num_errors, so the 'skipped' variable was redundant. Additionall

Re: pgsql: Fix expression list handling in ATExecAttachPartition()

2024-10-03 Thread Alexander Korotkov
Hi, Amit! On Thu, Oct 3, 2024 at 6:01 AM Amit Langote wrote: > Fix expression list handling in ATExecAttachPartition() +* since it’s needed later to construct the constraint expression for I don't think we're good about using unicode apostrophes. Could you, please, switch to ascii? --

Re: pgsql: Fix expression list handling in ATExecAttachPartition()

2024-10-03 Thread Amit Langote
On Thu, Oct 3, 2024 at 18:57 Alexander Korotkov wrote: > Hi, Amit! > > On Thu, Oct 3, 2024 at 6:01 AM Amit Langote > wrote: > > Fix expression list handling in ATExecAttachPartition() > > +* since it’s needed later to construct the constraint expression for > > I don't think we're good about

pgsql: Replace Unicode apostrophe with ASCII apostrophe

2024-10-03 Thread Amit Langote
Replace Unicode apostrophe with ASCII apostrophe In commit babb3993dbe9, I accidentally introduced a Unicode apostrophe (U+2019). This commit replaces it with the ASCII apostrophe (U+0027) for consistency. Reported-by: Alexander Korotkov Discussion: https://postgr.es/m/capphfdunwmbjkjftqxjremk6

Re: pgsql: Fix expression list handling in ATExecAttachPartition()

2024-10-03 Thread Amit Langote
On Thu, Oct 3, 2024 at 7:12 PM Amit Langote wrote: > On Thu, Oct 3, 2024 at 18:57 Alexander Korotkov wrote: >> >> Hi, Amit! >> >> On Thu, Oct 3, 2024 at 6:01 AM Amit Langote wrote: >> > Fix expression list handling in ATExecAttachPartition() >> >> +* since it’s needed later to construct the

Re: pgsql: Fix expression list handling in ATExecAttachPartition()

2024-10-03 Thread Alexander Korotkov
On Thu, Oct 3, 2024 at 2:02 PM Amit Langote wrote: > On Thu, Oct 3, 2024 at 7:12 PM Amit Langote > wrote: > > On Thu, Oct 3, 2024 at 18:57 Alexander Korotkov > wrote: > >> > >> Hi, Amit! > >> > >> On Thu, Oct 3, 2024 at 6:01 AM Amit Langote > wrote: > >> > Fix expression list handling in ATExe

pgsql: Fix incorrect non-strict join recheck in MERGE WHEN NOT MATCHED

2024-10-03 Thread Dean Rasheed
Fix incorrect non-strict join recheck in MERGE WHEN NOT MATCHED BY SOURCE. If a MERGE command contains WHEN NOT MATCHED BY SOURCE actions, the merge join condition is used by the executor to distinguish MATCHED from NOT MATCHED BY SOURCE cases. However, this qual is executed using the output from

pgsql: Fix incorrect non-strict join recheck in MERGE WHEN NOT MATCHED

2024-10-03 Thread Dean Rasheed
Fix incorrect non-strict join recheck in MERGE WHEN NOT MATCHED BY SOURCE. If a MERGE command contains WHEN NOT MATCHED BY SOURCE actions, the merge join condition is used by the executor to distinguish MATCHED from NOT MATCHED BY SOURCE cases. However, this qual is executed using the output from

pgsql: Fix wrong varnullingrels error for MERGE WHEN NOT MATCHED BY SOU

2024-10-03 Thread Dean Rasheed
Fix wrong varnullingrels error for MERGE WHEN NOT MATCHED BY SOURCE. If a MERGE command contains WHEN NOT MATCHED BY SOURCE actions, the source relation appears on the outer side of the join. Thus, any Vars referring to the source in the merge join condition, actions, and RETURNING list should be

pgsql: Fix wrong varnullingrels error for MERGE WHEN NOT MATCHED BY SOU

2024-10-03 Thread Dean Rasheed
Fix wrong varnullingrels error for MERGE WHEN NOT MATCHED BY SOURCE. If a MERGE command contains WHEN NOT MATCHED BY SOURCE actions, the source relation appears on the outer side of the join. Thus, any Vars referring to the source in the merge join condition, actions, and RETURNING list should be