Re: "unexpected duplicate for tablespace" problem in logical replication

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: vignesh C <vignesh21@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, wangsh.fnst@fujitsu.com, osumi.takamichi@fujitsu.com, pgsql-bugs@lists.postgresql.org, Andres Freund <andres@anarazel.de>
Date: 2025-08-21T21:36:56Z
Lists: pgsql-bugs

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Ignore temporary relations in RelidByRelfilenumber()

On Thu, Aug 21, 2025 at 07:54:55PM +0530, Ashutosh Bapat wrote:
> How about the following:
> 
> ---
> Map a relation's (tablespace, relfilenumber) to a relation's oid and
> cache the result.
> 
> A temporary relation may have the same relfilenumber as a permanent
> relation, or as other temporary relations. In order to uniquely
> identify a temporary relation we also need the
> proc number of the backend which created it. The proc number is not
> available to this function. Hence ignore temporary relations.
> 
> Returns InvalidOid if no permanent relation matching the criteria
> could be found.
> ---

That's simpler.

> Said that if you insist on adding just "Temporary relations are not
> supported", we can go ahead with it.

That would be simpler as well, providing the information.

> Vignesh, since you are the original author of the patch, do you want
> to take care of addressing the comments? Otherwise I can.

It's fine.  I am going to take care of that.
--
Michael