From: | Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com> |
---|---|
To: | "Bossart, Nathan" <bossartn(at)amazon(dot)com> |
Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Michael Paquier <michael(at)paquier(dot)xyz>, "masao(dot)fujii(at)gmail(dot)com" <masao(dot)fujii(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, "euler(at)timbira(dot)com(dot)br" <euler(at)timbira(dot)com(dot)br> |
Subject: | Re: Add support for INDEX_CLEANUP and TRUNCATE to vacuumdb |
Date: | 2020-06-11 09:03:43 |
Message-ID: | CA+fd4k5oGJbtq+JZFxr0ncpDsFx5FJonPH5ig0d7JWS30Qxg_A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, 11 Jun 2020 at 09:41, Bossart, Nathan <bossartn(at)amazon(dot)com> wrote:
>
> Hi hackers,
>
> I quickly put together a patch to add INDEX_CLEANUP and TRUNCATE to
> vacuumdb before noticing a previous thread for it [0]. My take on it
> was to just name the options --skip-index-cleanup and --skip-truncate.
> While that does not give you a direct mapping to the corresponding
> VACUUM options, it simplifies the patch by avoiding the boolean
> parameter parsing stuff altogether.
>
Thank you for updating the patch!
I looked at this patch.
@@ -412,6 +434,13 @@ vacuum_one_database(const char *dbname,
vacuumingOptions *vacopts,
exit(1);
}
+ if (vacopts->skip_index_cleanup && PQserverVersion(conn) < 120000)
+ {
+ PQfinish(conn);
+ pg_log_error("cannot use the \"%s\" option on server versions
older than PostgreSQL %s",
+ "skip-index-cleanup", "12");
+ }
+
if (vacopts->skip_locked && PQserverVersion(conn) < 120000)
{
PQfinish(conn);
exit(1) is missing after pg_log_error().
Regards,
--
Masahiko Sawada http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Langote | 2020-06-11 09:10:07 | problem with RETURNING and update row movement |
Previous Message | Masahiko Sawada | 2020-06-11 08:39:35 | Re: Internal key management system |