-
Notifications
You must be signed in to change notification settings - Fork 175
add display ivorysql version in psql welcome banner and select(). #939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2507621
dd916f3
233e86b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -24,18 +24,23 @@ Untested combinations of 'autoconf' and PostgreSQL versions are not | |||||||||||||||||||||||||||
| recommended. You can remove the check from 'configure.ac' but it is then | ||||||||||||||||||||||||||||
| your responsibility whether the result works or not.])]) | ||||||||||||||||||||||||||||
| AC_COPYRIGHT([Copyright (c) 1996-2025, PostgreSQL Global Development Group]) | ||||||||||||||||||||||||||||
| AC_COPYRIGHT([Portions Copyright (c), 2023-2025, IvorySQL Global Development Team]) | ||||||||||||||||||||||||||||
| AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c]) | ||||||||||||||||||||||||||||
| AC_CONFIG_AUX_DIR(config) | ||||||||||||||||||||||||||||
| AC_PREFIX_DEFAULT(/usr/local/pgsql) | ||||||||||||||||||||||||||||
| AC_DEFINE_UNQUOTED(CONFIGURE_ARGS, ["$ac_configure_args"], [Saved arguments from configure]) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # IvorySQL version | ||||||||||||||||||||||||||||
| PACKAGE_IVORYSQL_VERSION='5.0' | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| [PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`] | ||||||||||||||||||||||||||||
| [PG_MINORVERSION=`expr "$PACKAGE_VERSION" : '.*\.\([0-9][0-9]*\)'`] | ||||||||||||||||||||||||||||
| test -n "$PG_MINORVERSION" || PG_MINORVERSION=0 | ||||||||||||||||||||||||||||
| AC_SUBST(PG_MAJORVERSION) | ||||||||||||||||||||||||||||
| AC_DEFINE_UNQUOTED(PG_MAJORVERSION, "$PG_MAJORVERSION", [PostgreSQL major version as a string]) | ||||||||||||||||||||||||||||
| AC_DEFINE_UNQUOTED(PG_MAJORVERSION_NUM, $PG_MAJORVERSION, [PostgreSQL major version number]) | ||||||||||||||||||||||||||||
| AC_DEFINE_UNQUOTED(PG_MINORVERSION_NUM, $PG_MINORVERSION, [PostgreSQL minor version number]) | ||||||||||||||||||||||||||||
| AC_DEFINE_UNQUOTED([PACKAGE_IVORYSQL_VERSION], "$PACKAGE_IVORYSQL_VERSION" , [IvorySQL version number]) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| PGAC_ARG_REQ(with, extra-version, [STRING], [append STRING to version], | ||||||||||||||||||||||||||||
| [PG_VERSION="$PACKAGE_VERSION$withval"], | ||||||||||||||||||||||||||||
|
|
@@ -2553,7 +2558,7 @@ else | |||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| AC_DEFINE_UNQUOTED(PG_VERSION_STR, | ||||||||||||||||||||||||||||
| ["PostgreSQL $PG_VERSION on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"], | ||||||||||||||||||||||||||||
| ["PostgreSQL $PG_VERSION (IvorySQL $PACKAGE_IVORYSQL_VERSION) on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"], | ||||||||||||||||||||||||||||
| [A string containing the version number, platform, and C compiler]) | ||||||||||||||||||||||||||||
|
Comment on lines
+2561
to
2562
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainDefine PACKAGE_IVORYSQL_VERSION in Autoconf header to match Meson. To ensure src/include/pg_config.h defines PACKAGE_IVORYSQL_VERSION (not just leaves it #undef), add an option and define: @@
AC_DEFINE_UNQUOTED(PG_VERSION, "$PG_VERSION", [PostgreSQL version as a string])
+dnl IvorySQL version string (configurable; default 5.0)
+AC_ARG_WITH([ivorysql-version],
+ [AS_HELP_STRING([--with-ivorysql-version=VER], [set IvorySQL version string [5.0]])],
+ [PACKAGE_IVORYSQL_VERSION="$withval"],
+ [PACKAGE_IVORYSQL_VERSION="5.0"])
+AC_DEFINE_UNQUOTED([PACKAGE_IVORYSQL_VERSION], ["$PACKAGE_IVORYSQL_VERSION"], [IvorySQL version as a string])
+AC_SUBST([PACKAGE_IVORYSQL_VERSION])
+
@@
AC_DEFINE_UNQUOTED(PG_VERSION_STR,
- ["PostgreSQL $PG_VERSION (IvorySQL $PACKAGE_IVORYSQL_VERSION) on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
+ ["PostgreSQL $PG_VERSION (IvorySQL $PACKAGE_IVORYSQL_VERSION) on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
[A string containing the version number, platform, and C compiler])This keeps both build systems in lockstep and lets packagers override the IvorySQL version via configure. Length of output: 4117 🏁 Script executed: #!/bin/bash
# Search for all occurrences of PACKAGE_IVORYSQL_VERSION in configure.ac
rg -n "PACKAGE_IVORYSQL_VERSION" --type autoconf -C 5Length of output: 32 🏁 Script executed: #!/bin/bash
# Check if pg_config.h.in exists and contains PACKAGE_IVORYSQL_VERSION
fd -t f "pg_config\.h\.in" -x rg -n "PACKAGE_IVORYSQL_VERSION" {} -C 3Length of output: 209 🏁 Script executed: #!/bin/bash
# Search for AC_DEFINE_UNQUOTED calls to understand current pattern
rg -n "AC_DEFINE_UNQUOTED.*VERSION" --type autoconf -C 2Length of output: 32 🏁 Script executed: #!/bin/bash
# Check for Meson build configuration related to IvorySQL version
fd -t f "meson.build" -x rg -n "IVORYSQL\|ivorysql" {} -C 3Length of output: 0 Length of output: 500 🏁 Script executed: #!/bin/bash
# Search for AC_DEFINE_UNQUOTED with VERSION in configure.ac
rg "AC_DEFINE_UNQUOTED.*VERSION" -C 3 -- configure.acLength of output: 1354 🏁 Script executed: #!/bin/bash
# Look for where PACKAGE_IVORYSQL_VERSION might be initially set/assigned
rg "PACKAGE_IVORYSQL_VERSION\s*=" -C 3 -- configure.acLength of output: 0 🏁 Script executed: #!/bin/bash
# Search all meson files for IvorySQL version handling
find . -name "meson.build" -o -name "meson_options.txt" 2>/dev/null | head -20Length of output: 638 🏁 Script executed: #!/bin/bash
# Check if PACKAGE_IVORYSQL_VERSION appears in any AC_SUBST or AC_ARG_WITH
rg "AC_ARG_WITH|AC_SUBST.*IVORYSQL" -C 3 -- configure.acLength of output: 0 Length of output: 1553 🏁 Script executed: #!/bin/bash
# Check config/meson.build for version definitions
rg "IVORYSQL|ivorysql|PACKAGE_VERSION" ./config/meson.build -C 3 2>/dev/null | head -50Length of output: 0 🏁 Script executed: #!/bin/bash
# Look for version defines or conf settings in meson files
rg "conf\.set.*IVORYSQL|conf\.set.*VERSION" . -g "meson.build" -C 3 | head -50Length of output: 0 🏁 Script executed: #!/bin/bash
# Check if there's any VERSION variable or option defined in Meson
fd -t f "meson.build" -x grep -l "version\|VERSION" {} \; | head -5Length of output: 160 Add AC_DEFINE_UNQUOTED and AC_ARG_WITH for PACKAGE_IVORYSQL_VERSION in configure.ac to match Meson. Verification confirms Meson (./meson.build) correctly defines @@
AC_DEFINE_UNQUOTED(PG_VERSION, "$PG_VERSION", [PostgreSQL version as a string])
+dnl IvorySQL version string (configurable; default 5.0)
+AC_ARG_WITH([ivorysql-version],
+ [AS_HELP_STRING([--with-ivorysql-version=VER], [set IvorySQL version string [5.0]])],
+ [PACKAGE_IVORYSQL_VERSION="$withval"],
+ [PACKAGE_IVORYSQL_VERSION="5.0"])
+AC_DEFINE_UNQUOTED([PACKAGE_IVORYSQL_VERSION], ["$PACKAGE_IVORYSQL_VERSION"], [IvorySQL version as a string])
+AC_SUBST([PACKAGE_IVORYSQL_VERSION])
+
@@
AC_DEFINE_UNQUOTED(PG_VERSION_STR,
["PostgreSQL $PG_VERSION (IvorySQL $PACKAGE_IVORYSQL_VERSION) on $host, compiled by $cc_string, `expr $ac_cv_sizeof_void_p \* 8`-bit"],
[A string containing the version number, platform, and C compiler])📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Supply a numeric version string for use by 3rd party add-ons | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -155,7 +155,7 @@ cdata.set('PG_MAJORVERSION_NUM', pg_version_major) | |||||||||||||||||||||||||||
| cdata.set('PG_MINORVERSION_NUM', pg_version_minor) | ||||||||||||||||||||||||||||
| cdata.set('PG_VERSION_NUM', pg_version_num) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| cdata.set('PACKAGE_IVORYSQL_VERSION', ivorysql_version) | ||||||||||||||||||||||||||||
| cdata.set_quoted('PACKAGE_IVORYSQL_VERSION', ivorysql_version) | ||||||||||||||||||||||||||||
| # PG_VERSION_STR is built later, it depends on compiler test results | ||||||||||||||||||||||||||||
| cdata.set_quoted('CONFIGURE_ARGS', '') | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
@@ -2982,7 +2982,7 @@ cdata.set_quoted('DLSUFFIX', dlsuffix) | |||||||||||||||||||||||||||
| cdata.set_quoted('PG_VERSION_STR', | ||||||||||||||||||||||||||||
| 'PostgreSQL (IvorySQL @6@) @0@ on @1@-@2@, compiled by @3@-@4@, @5@-bit'.format( | ||||||||||||||||||||||||||||
| pg_version, host_machine.cpu_family(), host_system, | ||||||||||||||||||||||||||||
| cc.get_id(), cc.version(), cdata.get('SIZEOF_VOID_P') * 8, cdata.get('PACKAGE_IVORYSQL_VERSION') | ||||||||||||||||||||||||||||
| cc.get_id(), cc.version(), cdata.get('SIZEOF_VOID_P') * 8, ivorysql_version | ||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||
|
Comment on lines
2982
to
2987
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainMake PG_VERSION_STR ordering match Autoconf and example output. Meson currently emits "PostgreSQL (IvorySQL 5.0) 18.0 ...", while Autoconf emits "PostgreSQL 18.0 (IvorySQL 5.0) ...". Align with Autoconf and the PR examples for consistency across build systems. Apply: - cdata.set_quoted('PG_VERSION_STR',
- 'PostgreSQL (IvorySQL @6@) @0@ on @1@-@2@, compiled by @3@-@4@, @5@-bit'.format(
+ cdata.set_quoted('PG_VERSION_STR',
+ 'PostgreSQL @0@ (IvorySQL @6@) on @1@-@2@, compiled by @3@-@4@, @5@-bit'.format(
pg_version, host_machine.cpu_family(), host_system,
cc.get_id(), cc.version(), cdata.get('SIZEOF_VOID_P') * 8, ivorysql_version
)
)Length of output: 437 🏁 Script executed: #!/bin/bash
# Search for Autoconf equivalents (configure.in, configure.ac, etc.)
echo "=== Looking for Autoconf files ==="
find . -name 'configure.*' -o -name 'config.in' -o -name 'config.ac' | head -10Length of output: 49 🏁 Script executed: #!/bin/bash
# Search for PG_VERSION_STR definitions in Autoconf files
echo "=== Searching for PG_VERSION_STR in Autoconf context ==="
rg -n 'PG_VERSION_STR' --type=in --type=ac -C5 2>/dev/null | head -50Length of output: 56 🏁 Script executed: #!/bin/bash
# Look for references to version ordering in comments or documentation
echo "=== Searching for version string format context ==="
rg -n 'PostgreSQL.*IvorySQL|IvorySQL.*PostgreSQL' -C3 2>/dev/null | head -40Length of output: 2668 Align PG_VERSION_STR format order between Meson and Autoconf. Meson currently outputs "PostgreSQL (IvorySQL @6@) @0@ on...", while Autoconf outputs "PostgreSQL @0@ (IvorySQL @6@) on...". Swap the positions of - cdata.set_quoted('PG_VERSION_STR',
- 'PostgreSQL (IvorySQL @6@) @0@ on @1@-@2@, compiled by @3@-@4@, @5@-bit'.format(
+ cdata.set_quoted('PG_VERSION_STR',
+ 'PostgreSQL @0@ (IvorySQL @6@) on @1@-@2@, compiled by @3@-@4@, @5@-bit'.format(
pg_version, host_machine.cpu_family(), host_system,
cc.get_id(), cc.version(), cdata.get('SIZEOF_VOID_P') * 8, ivorysql_version
)
)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -630,6 +630,9 @@ | |
| /* PostgreSQL version as a number */ | ||
| #undef PG_VERSION_NUM | ||
|
|
||
| /*IvorySQL version as a string*/ | ||
| #undef PACKAGE_IVORYSQL_VERSION | ||
|
|
||
|
Comment on lines
+633
to
+635
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainHeader placeholder added; ensure Autoconf defines it. The #undef exposes PACKAGE_IVORYSQL_VERSION, but Autoconf must define it for non‑Meson builds. Verify configure.ac (or generated configure) sets and AC_DEFINEs PACKAGE_IVORYSQL_VERSION, else clients will see it undefined. Run: 🏁 Script executed: #!/bin/bash
# Verify Autoconf defines PACKAGE_IVORYSQL_VERSION
rg -nP 'AC_DEFINE(_UNQUOTED)?\s*\(\s*PACKAGE_IVORYSQL_VERSION' configure.ac || true
rg -nP '\bPACKAGE_IVORYSQL_VERSION\b' configure.ac || trueLength of output: 159 Need to verify if Length of output: 555 Need to find where Length of output: 0 The variable appears undefined. Let me search more broadly for IvorySQL context and verify the pg_config.h.in file: Length of output: 504 PACKAGE_IVORYSQL_VERSION is undefined in configure.ac; AC_DEFINE is missing. Verification confirms the review concern is valid. Required fix: Add 🤖 Prompt for AI Agents |
||
| /* A string containing the version number, platform, and C compiler */ | ||
| #undef PG_VERSION_STR | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configure is usually generated by autoconf tool. Unsure if autoconf tool needs to be run each time the configure.ac is changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it‘s reasonable to be concerned about that after autoconf executed, the configure file will be covered.
fix it now.