Re: teach pg_upgrade to handle in-place tablespaces - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: teach pg_upgrade to handle in-place tablespaces
Date
Msg-id CADkLM=etS=Yevibo_zfPMicpeyVR0q=D87e1Q0EHe1p3m2xiDA@mail.gmail.com
Whole thread Raw
In response to Re: teach pg_upgrade to handle in-place tablespaces  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: teach pg_upgrade to handle in-place tablespaces
List pgsql-hackers

On Tue, Jul 1, 2025 at 4:06 PM Nathan Bossart <nathandbossart@gmail.com> wrote:
rebased

--
nathan

Everything here makes sense to me, but I do have one question:

In src/bin/pg_upgrade/info.c
@@ -616,11 +630,21 @@ process_rel_infos(DbInfo *dbinfo, PGresult *res, void *arg)
+ if (inplace)
+ tablespace = psprintf("%s/%s",
+  os_info.running_cluster->pgdata,
+  PQgetvalue(res, relnum, i_spclocation));
+ else
+ tablespace = PQgetvalue(res, relnum, i_spclocation);

I'm sure it's no big deal, but we've already PQgetvalue() fetched that once for spcloc, and we're going to fetch it again no matter what the value of inplace is. Is there a reason to not reuse spcloc?

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Parallel heap vacuum
Next
From: Noah Misch
Date:
Subject: Re: Non-text mode for pg_dumpall