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

From Rui Zhao
Subject Re: pg_upgrade fails with in-place tablespace
Date
Msg-id 0fdb4f37-7325-42ab-b465-b9201400724a.xiyuan.zr@alibaba-inc.com
Whole thread Raw
In response to Re: pg_upgrade fails with in-place tablespace  (Michael Paquier <michael@paquier.xyz>)
Responses Re: pg_upgrade fails with in-place tablespace
List 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



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: pg15: reltuples stuck at -1 after pg_upgrade and VACUUM
Next
From: Junwang Zhao
Date:
Subject: [BackendXidGetPid] only access allProcs when xid matches