AGE在PG 16上的安装出现错误:无法创建src/backend/parser/ag_scanner.c。

huangapple go评论62阅读模式
英文:

AGE Installation for PG 16 throws error: could not create src/backend/parser/ag_scanner.c

问题

我已安装postgres-16-beta,并被分配了一个项目,以使AGE与PostgreSQL 16一起使用成为可能。我已经使用以下配置配置了postgres:

./configure --prefix=$(pwd) --enable-cassert --enable-debug CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer"

之后执行make install命令,并且执行得很好。

然后,我键入以下命令以安装AGE:

make PG_CONFIG=~/Documents/PostgreSQL/postgresql-16beta1/bin/pg_config install

但是它抛出了以下错误:

/usr/bin/flex -b  -o'src/backend/parser/ag_scanner.c' src/backend/parser/ag_scanner.l
flex: could not create src/backend/parser/ag_scanner.c
make: *** [/home/user_name/Documents/PostgreSQL/postgresql-16beta1/lib/pgxs/src/makefiles/../../src/Makefile.global:770: src/backend/parser/ag_scanner.c] Error 1

我从这个仓库下载了AGE。我使用的是Fedora Linux 38。

英文:

I have installed postgres-16-beta and I was assigned to a project to make possible to use AGE with PostgreSQL 16. I have configured postgres with:

./configure --prefix=$(pwd) --enable-cassert --enable-debug CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer"

After that the make install command is executed and it goes fine with it.

Then I type the following command to install AGE:

make PG_CONFIG=~/Documents/PostgreSQL/postgresql-16beta1/bin/pg_config install

But it throws this error:

/usr/bin/flex -b  -o'src/backend/parser/ag_scanner.c' src/backend/parser/ag_scanner.l
flex: could not create src/backend/parser/ag_scanner.c
make: *** [/home/user_name/Documents/PostgreSQL/postgresql-16beta1/lib/pgxs/src/makefiles/../../src/Makefile.global:770: src/backend/parser/ag_scanner.c] Error 1

Downloaded age from this repo.
I'm using Fedora Linux 38.

答案1

得分: 3

尝试以根用户身份执行以下命令,如下所示:

sudo make PG_CONFIG=~/Documents/PostgreSQL/postgresql-16beta1/bin/pg_config install

如果这不起作用,您可以在 src/backend/parser 目录中手动构建 ag_scanner.c,使用以下命令:

flex -o ag_scanner.c ag_scanner.l
英文:

Try executing the command as the root user, like this:

sudo make PG_CONFIG=~/Documents/PostgreSQL/postgresql-16beta1/bin/pg_config install

If this doesn't work, you can build the ag_scanner.c manually using this command in the src/backend/parser directory:

flex -o ag_scanner.c ag_scanner.l

答案2

得分: 0

使用超级用户sudo运行上述命令。大多数关于安装AGE的帖子都建议这样做。

英文:
make PG_CONFIG=~/Documents/PostgreSQL/postgresql-16beta1/bin/pg_config install

The command above should be run using superuser sudo. Most posts for installing AGE suggest that.

答案3

得分: 0

进行完这个命令后尝试使用 make 命令,并检查主目录中的 bin 文件夹。

ls

cd bin

然后在 bin 文件夹内部检查 pg_config 文件。然后尝试使用 pwd 命令显示 bin 文件夹的路径

然后进入 age 文件夹,然后使用

sudo make PG_CONFIG=path/to/bin/pg_config install
英文:
./configure --prefix=$(pwd) --enable-cassert --enable-debug CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer"

after this command try make command and check for bin folder in main dir.

ls

cd bin

then inside bin check for pg_config file init. then try pwd command to display the path to bin folder

then move to age dir and then use

sudo make PG_CONFIG=path/to/bin/pg_config install

答案4

得分: 0

我遇到了相同的错误。在命令开头使用 sudo 安装 AGE 正常运行了。

这是最终的命令。

sudo make PG_CONFIG=home/zeeshan/Desktop/pg16/pg/postgresql-16beta1/bin/pg_config install

根据你的路径进行修改。

英文:

I ran into the same error. Using sudo at the begining of the command to install AGE worked fine for me.

here is the final command.

sudo make PG_CONFIG=home/zeeshan/Desktop/pg16/pg/postgresql-16beta1/bin/pg_config install

Change it according to you path.

答案5

得分: 0

根据您的截图,您没有超级用户权限。我安装了相同的版本。您可以使用以下命令以sudo权限运行:

sudo make PG_CONFIG=/home/hannanaamir/age_installation/pg/postgresql-16beta1/bin/pg_config install

然后,要运行回归测试,您可以使用以下命令:

make PG_CONFIG=/home/hannanaamir/age_installation/pg/postgresql-16beta1/bin/pg_config installcheck

对于 AGE 的支持正在进行中,因此目前许多回归测试将失败。此刻,针对 pg16 的 AGE 有 19/24 个测试案例失败。

英文:

According to your screenshot you simply do not have superuser privilages. I installed the same version. You can use the command with sudo like this

sudo make PG_CONFIG=/home/hannanaamir/age_installation/pg/postgresql-16beta1/bin/pg_config install

and then to run the regression tests you can use

make PG_CONFIG=/home/hannanaamir/age_installation/pg/postgresql-16beta1/bin/pg_config installcheck

> Support for AGE is underway so currently many of the regression tests will fail. At this moment AGE for pg16 has 19/24 failed test cases

huangapple
  • 本文由 发表于 2023年6月8日 01:04:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/76425606.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定