Re: Reject COPY TO of unlogged relations during recovery

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
Cc: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Reject COPY TO of unlogged relations during recovery
Date: 2026-10-16 18:11:36
Message-ID: CAD21AoDNa7pL760_23AN_wYPMkWXCt+Kw0_vJAcci4R5DoCQGg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 16, 2026 at 4:06 AM Jim Jones <jim(dot)jones(at)uni-muenster(dot)de> wrote:
>
> On 16/10/2026 09:34, Jim Jones wrote:
> > So I am not sure how the mentioned contrib modules should behave. But I
> > agree that anything is better than the current error message:
> >
> > postgres=# select * from pgrowlocks('ut');
> > ERROR: could not open file "base/5/16410": No such file or directory
> >
> > That said, I would be in favour of creating a separate patch for the
> > contrib modules. WDYT?
>
> I took a look at the contrib modules and the fix is pretty much
> identical everywhere. Regarding how to approach it, it I guess where a
> function fails today with "could not open file", it's fine to report a
> proper error message instead -- this rather unhelpful error message is
> sitting there for a long time and didn't seem to bother anybody.
>
> Thoughts?

While I agree that we can report a proper error message instead at
these places, I think we need to note that pageinspect's check for
init fork should work even on the standby.

Also, currtid2() seems to have the same issue.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Harrison Booth 2026-10-16 18:28:35 Re: [PATCH] pg_upgrade: handle failed nonblocking connects on Windows
Previous Message Lucas Jeffrey 2026-10-16 17:56:15 Re: [PATCH] Fix segmentation fault caused by reentrancy in RI_Fkey_cascade_del (ri_triggers.c)