On Thu, 11 Jun 2020 at 09:41, Bossart, Nathan <bossa...@amazon.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


Reply via email to