From: | Amit Khandekar <amitdkhan(dot)pg(at)gmail(dot)com> |
---|---|
To: | Dmitry Dolgov <9erthalion6(at)gmail(dot)com> |
Cc: | Andres Freund <andres(at)anarazel(dot)de>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Peter Geoghegan <pg(at)bowt(dot)ie>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Pluggable Storage - Andres's take |
Date: | 2019-01-14 13:06:59 |
Message-ID: | CAJ3gD9esXeRL-OYix13xvC=JCprxrrN+p2smhRrqQ5t6k9wZSg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Thanks for the patch updates.
A few comments so far from me :
+static void _selectTableAccessMethod(ArchiveHandle *AH, const char
*tablespace);
tablespace => tableam
+_selectTableAccessMethod(ArchiveHandle *AH, const char *tableam)
+{
+ PQExpBuffer cmd = createPQExpBuffer();
createPQExpBuffer() should be moved after the below statement, so that
it does not leak memory :
if (have && strcmp(want, have) == 0)
return;
char *tableam; /* table access method, onlyt for TABLE tags */
Indentation is a bit misaligned. onlyt=> only
@@ -2696,6 +2701,7 @@ ReadToc(ArchiveHandle *AH)
te->tablespace = ReadStr(AH);
te->owner = ReadStr(AH);
+ te->tableam = ReadStr(AH);
Above, I am not sure about the this, but possibly we may require to
have archive-version check like how it is done for tablespace :
if (AH->version >= K_VERS_1_10)
te->tablespace = ReadStr(AH);
So how about bumping up the archive version and doing these checks ?
Otherwise, if we run pg_restore using old version, we may read some
junk into te->tableam, or possibly crash. As I said, I am not sure
about this due to lack of clear understanding of archive versioning,
but let me know if you indeed find this issue to be true.
From | Date | Subject | |
---|---|---|---|
Next Message | James Coleman | 2019-01-14 14:05:17 | Re: Proving IS NOT NULL inference for ScalarArrayOpExpr's |
Previous Message | Heikki Linnakangas | 2019-01-14 12:53:35 | Re: [Patch] Create a new session in postmaster by calling setsid() |