Re: file_fdw: Fix ANALYZE crashes with DEFAULT markers

From: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: file_fdw: Fix ANALYZE crashes with DEFAULT markers
Date: 2026-11-04 10:46:28
Message-ID: 36b09eb8-db1f-4fa9-8904-e25658b54e14@uni-muenster.de
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Fujii

On 04/11/2026 11:13, Fujii Masao wrote:
> Attached patch fixes this by providing an expression context for sampling.
> This should be backpatched to v16, where DEFAULT marker support was
> introduced.

I was able to reproduce the bug and your patch fixes it. Just for my
understanding: why use ReScanExprContext instead of ResetExprContext here?

- /* Fetch next row */
- MemoryContextReset(tupcontext);
- MemoryContextSwitchTo(tupcontext);
+ /* Clean up the previous row's expression evaluation state */
+ ReScanExprContext(econtext);

Thanks for the patch!

Best, Jim

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Zhijie Hou 2026-11-04 10:28:52 Re: Proposal: Conflict log history table for Logical Replication