Re: System views for versions reporting

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: System views for versions reporting
Дата
Msg-id d7d0315b35a5f71660b1b40fa1f5c3194d78dad8.camel@cybertec.at
обсуждение исходный текст
Ответ на Re: System views for versions reporting  (Dmitry Dolgov <9erthalion6@gmail.com>)
Ответы Re: System views for versions reporting
Список pgsql-hackers
On Tue, 2025-11-25 at 16:40 +0100, Dmitry Dolgov wrote:
> Here is the updated patch.

Thanks for the updated patch.

Comments:

You didn't address any of my suggestions concerning the documentation,
except that you moved the entry in "System Views" to the correct place.

The second patch contains:

> +void
> +jit_register_version(void)
> +{
> +   add_system_version("LLVM", jit_get_version, RunTime);
> +}

But that belongs into the third patch.

+/*
+ * Callback for add_system_version, returns JIT provider's version string and
+ * reports if it's not available.
+ */
+const char *
+jit_get_version(bool *available)
+{
+   const char *version;
+
+   if (!provider_init())
+   {
+       *available = false;
+       return "";
+   }
+
+   version = provider.get_version();
+
+   if (version == NULL)
+   {
+       *available = false;
+       return "";
+   }
+
+   *available = true;
+   return version;
+}

Perhaps more elegant would be:

    if (provider_init())
    {
        version = provider.get_version();
        if (version)
        {
            *available = true;
            return version;
        }
    }

    *available = false;
    return "";

Other than that, it looks fine.

Yours,
Laurenz Albe



В списке pgsql-hackers по дате отправления: