gpt4 book ai didi

ERROR: could not load library "/usr/local/pgsql-13/lib/age.so": /usr/local/pgsql-13/lib/age.so: undefined symbol: hash_any_extended(错误:无法加载库“/usr/local/pgsql-13/lib/age.so”:/usr/local/pgsql-13/lib/age.so:未定义符号:HASH_ANY_EXTENDED)

转载 作者:bug小助手 更新时间:2023-10-25 21:43:21 30 4
gpt4 key购买 nike



I'm working with postgres 13 (REL_13_STABLE branch) from source code, and I'm using Apache AGE version 1.3.0 for that from (release/PG13/1.3.0 branch) from apachea/age source code which should be compatible with the version of postgres I'm using, but when I try to CREATE EXTENSION age; I get the following error:

我正在使用源代码中的Postgres 13(Rel_13_STRATE分支),并且我使用的是来自apachea/age源代码的(Release/PG13/1.3.0分支)中的1.3.0版的Apacheage,它应该与我正在使用的postgres版本兼容,但是当我尝试创建扩展年龄时,我得到了以下错误:


postgres=# CREATE EXTENSION age;
ERROR: could not load library "/usr/local/pgsql-13/lib/age.so": /usr/local/pgsql-13/lib/age.so: undefined symbol: hash_any_extended

though I checked /usr/local/pgsql-13/lib/ and age.so turned to be stored there, therefore the error mostly for stating that I'm using incompatible versions of Postgresql and Apache AGE, even though I'm using branches supporting PG13 which should be compatible. So if this is the case what is the cause for the problem and how to solve?.

虽然我检查了/usr/local/pgsql-13/lib/和age.so存储在那里,因此错误主要是因为声明我使用的是不兼容的PostgreSQL和Apacheage版本,即使我使用的是支持PG13的分支,这应该是兼容的。如果是这样的话,问题的原因是什么,如何解决?


更多回答

You built the extension against a different version of PostgreSQL.

您在不同版本的PostgreSQL上构建了扩展。

优秀答案推荐

It is possible that some other version of Apache AGE or Postgres still has files in your system. To ensure that Postgres 13 is being used, you can run the command psql -c "SELECT version();" in your terminal.

您的系统中可能仍有某些其他版本的Apacheage或Postgres文件。要确保使用的是Postgres13,可以在终端中运行命令psql-c“SELECT VERSION();”。


To address this issue, try running the following commands from your Apache AGE source code folder:

要解决此问题,请尝试从您的Apacheage源代码文件夹运行以下命令:


sudo make PG_CONFIG=/usr/local/pgsql-13/bin/pg_config clean
sudo make PG_CONFIG=/usr/local/pgsql-13/bin/pg_config
sudo make PG_CONFIG=/usr/local/pgsql-13/bin/pg_config install

If the error persists after running the commands to clean and rebuild Apache AGE, you could consider uninstalling both PostgreSQL and Apache AGE and then reinstalling them with other compatible versions.

如果在运行清理和重建apache age的命令后错误仍然存在,您可以考虑卸载PostgreSQL和apache age,然后使用其他兼容版本重新安装它们。


Note: you can use the branch PG13 instead of release/PG13/1.3.0 branch.

注意:您可以使用分支PG 13而不是release/PG 13/1.3.0分支。



I believe your ApacheAge extension is not built correctly. Try rebuilding it and make sure to run regression tests after building the extension. Try running the below commands in your ApacheAge source directory:

我相信您的ApacheAge扩展没有正确构建。尝试重新构建它,并确保在构建扩展之后运行回归测试。尝试在ApacheAge源目录中运行以下命令:


make clean PG_CONFIG=/usr/local/pgsql-13/bin/pg_config 
make PG_CONFIG=/usr/local/pgsql-13/bin/pg_config
make install PG_CONFIG=/usr/local/pgsql-13/bin/pg_config
make installcheck PG_CONFIG=/usr/local/pgsql-13/bin/pg_config

The above commands will do a clean install of your ApacheAge source code.

以上命令将执行ApacheAge源代码的全新安装。



The error undefined symbol: hash_any_extended suggests that the age.so library is built against a different version of PostgreSQL you are using. You can try to download the source code from the official PostgreSQL directory and test different minor versions. There are minor versions of PostgreSQL from 13.0 to 13.11. Also, make sure you made a clean clone from the AGE repository to use with a different version of PostgreSQL. It prevents old files from older installations from polluting the new build.

错误UNDEFINED SYMBOL:HASH_ANY_EXTENDED表明age.so库是针对您正在使用的不同版本的PostgreSQL构建的。您可以尝试从官方的PostgreSQL目录下载源代码,并测试不同的次要版本。PostgreSQL有从13.0到13.11的次要版本。此外,确保您从AGE存储库中创建了一个干净的克隆,以便与不同版本的PostgreSQL一起使用。它可以防止来自旧安装的旧文件污染新构建。



The following line means that you are using an incompatible version of the PostgreSQL:

以下行表示您使用的是不兼容的PostgreSQL版本:


ERROR:  could not load library "/usr/local/pgsql-13/lib/age.so": /usr/local/pgsql-13/lib/age.so: undefined symbol: hash_any_extended

Verify the compatible versions of PostgreSQL in the AGE Releases section github: AGE RELEASES

在AGE发布部分GitHub:AGE Release中验证PostgreSQL的兼容版本


You can install the compatible version of PostgreSQL by the following link:
PostgreSQL Downloads

您可以通过以下链接安装兼容版本的PostgreSQL:PostgreSQL下载



The safest way to fix it is to unistall postgres using make uninstall and make clean and also deleting the files in the path usr/local/pgsql-13, then proceed to install postgres and the extension again and make sure the branches are the correct/compatible versions

修复该问题的最安全方法是使用make uninstall和make lean卸载postgres,并删除路径usr/local/pgsql-13中的文件,然后再次安装postgres和扩展模块,并确保分支是正确/兼容的版本



The error suggests that you might have different versions of PostgreSQL installed in your PC and the wrong version is being used when you try to create the AGE extension.

该错误表明您的PC上可能安装了不同版本的PostgreSQL,并且在您尝试创建AGE扩展时使用了错误的版本。


In your postgreSQL cli, type:

在您的PostgreSQL CLI中,键入:


SELECT version();

to find your version of PostgreSQL. If the returned version is not PosgreSQL 13, change the path to point to bin of the correct version. Make sure you have separate directories for different versions of PostgreSQL installed.

找到您的PostgreSQL版本。如果返回的版本不是PosgreSQL 13,则将路径更改为指向正确版本的bin。确保您为不同版本的PostgreSQL安装了单独的目录。


Otherwise, if the correct version is returned, another possibility is that AGE wasn't built correctly. Refer to @wendel's answer in that case.

否则,如果返回正确的版本,另一种可能是年龄构建不正确。在这种情况下,请参考@温德尔的回答。



first clean all the previous installation by using

首先使用以下命令清除所有以前的安装


sudo make clean

now reinstall the postgres v13 from the github make sure to checkout pg13

现在从GitHub重新安装Postgres V13,确保签出PG13


https://github.com/postgres/postgres.git

then install age, set the env and run

然后安装age,设置env并运行


sudo make PG_CONFIG=/usr/local/pgsql-13/bin/pg_config clean
sudo make PG_CONFIG=/usr/local/pgsql-13/bin/pg_config
sudo make install PG_CONFIG=/usr/local/pgsql-13/bin/pg_config install
sudo make PG_CONFIG=/usr/local/pgsql-13/bin/pg_config installcheck


I advise you to use the PG13 branch instead of the release/PG13/1.3.0 branch. I faced the same error when I used a newer version of age when I had installed and older version before.
You should reinstall postgreSQL 13 from source code. Then clone the git repository and move to the PG13 branch and install AGE from there using commands.

我建议您使用PG13分支,而不是Release/PG13/1.3.0分支。当我使用较新版本的AGE时,我遇到了同样的错误,而我之前安装了较旧的版本。您应该从源代码重新安装PostgreSQL13。然后克隆git存储库并移动到pg13分支,并使用命令从那里安装age。


make PG_CONFIG=/usr/local/pgsql-13/bin/pg_config install
make PG_CONFIG=/usr/local/pgsql-13/bin/pg_config installcheck


The error indicates that age.so library is built against a different version of PostgreSQL.
To resolve the issue, try these options:

该错误指示age.so库是针对不同版本的PostgreSQL构建的。要解决此问题,请尝试以下选项:



  • Make sure you are using the correct and compatible branches of Apache
    AGE and PostgreSQL.

    确保您使用的是正确且兼容的Apacheage和PostgreSQL分支。



  • Clean your Apache AGE source code folder using this command:

    使用以下命令清理您的Apacheage源代码文件夹:


    sudo make PG_CONFIG=/usr/local/pgsql-13/bin/pg_config clean


  • Run these commands to rebuild Apache AGE with the correct PostgreSQL
    version:

    运行以下命令以使用正确的PostgreSQL版本重建Apache旧版本:


    sudo make PG_CONFIG=/usr/local/pgsql-13/bin/pg_config
    sudo make PG_CONFIG=/usr/local/pgsql-13/bin/pg_config install


  • If the error still exists then try uninstalling both Apache AGE and
    PostgreSQL completely and reinstalling with compatible versions.

    如果错误仍然存在,请尝试完全卸载Apacheage和PostgreSQL,然后使用兼容的版本重新安装。



  • You can check your PostgreSQL version using this command:

    您可以使用以下命令检查您的PostgreSQL版本:


    psql -c "SELECT version();


  • Also make sure you have clean clone of Apache AGE.

    还要确保你有阿帕奇时代的干净克隆。




更多回答

Thanks it worked, btw it's make clean PG_CONFIG=/usr/local/pgsql-13/bin/pg_config with configuration file path provided, thanks again.

谢谢它起作用了,顺便说一句,它是make lean pg_config=/usr/local/pgsql-13/bin/pg_config,并提供了配置文件路径,再次感谢。

I'm glad it worked! Sorry about that, I forgot to include the file path in make clean. I'll edit and add it now so that everything is clear

我很高兴它成功了!很抱歉,我忘了在Make Clear中包含文件路径。我现在要编辑并添加它,这样一切都清楚了

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com