Re: System views for versions reporting - Mailing list pgsql-hackers

From jian he
Subject Re: System views for versions reporting
Date
Msg-id CACJufxFD7ra6-HYmksJPMrY8Q036HA6EFyrUjrOPiq8CrfkGvg@mail.gmail.com
Whole thread Raw
In response to Re: System views for versions reporting  (Joe Conway <mail@joeconway.com>)
Responses Re: System views for versions reporting
List 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).



pgsql-hackers by date:

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