Re: System views for versions reporting

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Cc: Joe Conway <mail(at)joeconway(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: System views for versions reporting
Date: 2025-01-02 02:36:48
Message-ID: CACJufxFD7ra6-HYmksJPMrY8Q036HA6EFyrUjrOPiq8CrfkGvg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

hi.
https://cirrus-ci.com/github/postgresql-cfbot/postgresql/cf%2F5318
shows lots of failures, but it doesn't seem to tell you about doc build failure.

+ <sect1 id="view-pg-system-versions">
+ <title><structname>pg_system_versions</structname></title>
+
+ <indexterm zone="view-pg-system-version">
+ <primary>pg_system_versions</primary>
+ </indexterm>

+ <indexterm zone="view-pg-system-version">
should change to
+ <indexterm zone="view-pg-system-versions">
otherwise cannot build doc.

+ <table>
+ <title><structname>pg_system_versions</structname> Columns</title>
+ <tgroup cols="1">
...
column "type" of view pg_system_versions is missing in the doc entry
?

+ if (found)
+ ereport(ERROR,
+ (errcode(ERRCODE_DUPLICATE_OBJECT),
+ errmsg("duplicated system version")));
this is unlikely to happen (not user visible error), normally we
should just use elog(ERROR...)
?

+typedef enum VersionType
+{
+ CompileTime,
+ RunTime,
+} VersionType;
+
+typedef struct SystemVersion
+{
+ char name[NAMEDATALEN]; /* Unique component name, used as a key
+ * for versions HTAB */
+ VersionType type;
+ SystemVersionCB callback; /* Callback to fetch the version string */
+} SystemVersion;
these two structs also need to be added into src/tools/pgindent/typedefs.list?

--- a/src/include/utils/system_version.h
+++ b/src/include/utils/system_version.h
@@ -11,6 +11,7 @@
#ifndef SYSTEM_VERSION_H
#define SYSTEM_VERSION_H

+#include <gnu/libc-version.h>
#include <link.h>

"gnu/libc-version.h" does not exist in the clang compiler?
will "link.h" everywhere?

Currently, only a few rows are displayed for pg_system_versions. If I have
linked a dependency, I should be able to retrieve its version—for example, I
should be able to determine the version of zstd (i have linked the
zstd dependency).

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2025-01-02 02:45:57 Re: System views for versions reporting
Previous Message Bruce Momjian 2025-01-02 02:03:59 Re: Backport of CVE-2024-10978 fix to older pgsql versions (11, 9.6, and 9.4)