Re: pg_upgrade fails with in-place tablespace - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: pg_upgrade fails with in-place tablespace
Date
Msg-id ZOBI9A+jXug67tt+@paquier.xyz
Whole thread Raw
In response to Re: pg_upgrade fails with in-place tablespace  ("Rui Zhao" <xiyuan.zr@alibaba-inc.com>)
Responses Re: pg_upgrade fails with in-place tablespace
List pgsql-hackers
On Fri, Aug 18, 2023 at 10:47:04PM +0800, Rui Zhao wrote:
> I have implemented the changes you suggested in our previous
> discussion. I have added the necessary code to ensure that
> pg_upgrade fails gracefully with in-place tablespaces and reports a
> hint to let the check pass.

+    /*
+     * No need to check in-place tablespaces when allow_in_place_tablespaces is
+     * on because they are part of the data folder.
+     */
+    if (allow_in_place_tablespaces)
+        snprintf(query, sizeof(query),
+                 "%s AND pg_catalog.pg_tablespace_location(oid) != 'pg_tblspc/' || oid", query);

I am not sure to follow the meaning of this logic.  There could be
in-place tablespaces that got created with the GUC enabled during a
session, while the GUC has disabled the GUC.  Shouldn't this stuff be
more restrictive and not require a lookup at the GUC, only looking at
the paths returned by pg_tablespace_location()?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: [PATCH] Add function to_oct
Next
From: Michael Paquier
Date:
Subject: Re: Ignore 2PC transaction GIDs in query jumbling