Re: pg_upgrade fails with in-place tablespace

From: "Rui Zhao" <xiyuan(dot)zr(at)alibaba-inc(dot)com>
To: "Michael Paquier" <michael(at)paquier(dot)xyz>
Cc: "pgsql-hackers" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_upgrade fails with in-place tablespace
Date: 2023-08-09 03:47:58
Message-ID: 0fdb4f37-7325-42ab-b465-b9201400724a.xiyuan.zr@alibaba-inc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have found the patch and upon review, I believe the following code can be improved.
+ /*
+ * In-place tablespaces use a relative path, and need to be dumped
+ * with an empty string as location.
+ */
+ if (is_absolute_path(spclocation))
+ appendStringLiteralConn(buf, spclocation, conn);
+ else
+ appendStringLiteralConn(buf, "", conn);
I believe that utilizing appendPQExpBufferStr(buf, "''"); would be better and more meaningful than using appendStringLiteralConn(buf, "", conn); in this scenario.
I apologize for this wrong usage. Please help me fix it.
I will try to respond to pg_upgrade after my deep dive.
--
Best regards,
Rui Zhao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Junwang Zhao 2023-08-09 04:00:34 [BackendXidGetPid] only access allProcs when xid matches
Previous Message Justin Pryzby 2023-08-09 03:43:28 pg15: reltuples stuck at -1 after pg_upgrade and VACUUM