Skip to content
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

PostgreSQL 17 support #39

Open
Vonng opened this issue Oct 16, 2024 · 13 comments
Open

PostgreSQL 17 support #39

Vonng opened this issue Oct 16, 2024 · 13 comments
Assignees

Comments

@Vonng
Copy link

Vonng commented Oct 16, 2024

Fail to build against PostgreSQL 17

make[4]: Entering directory '/home/vagrant/pigsty-deb/pg-store-plan/build'
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -g -O2 -ffile-prefix-map=/home/vagrant/pigsty-deb/pg-store-plan/build=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -fvisibility=hidden -fPIC -fvisibility=hidden -I. -I./ -I/usr/include/postgresql/17/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o pg_store_plans.o pg_store_plans.c
In file included from /usr/include/postgresql/17/server/executor/instrument.h:16,
                 from /usr/include/postgresql/17/server/nodes/execnodes.h:33,
                 from /usr/include/postgresql/17/server/executor/execdesc.h:18,
                 from /usr/include/postgresql/17/server/executor/executor.h:17,
                 from /usr/include/postgresql/17/server/commands/explain.h:16,
                 from pg_store_plans.c:41:
pg_store_plans.c: In function ‘pgsp_store’:
pg_store_plans.c:1359:72: error: ‘BufferUsage’ has no member named ‘blk_read_time’; did you mean ‘temp_blk_read_time’?
 1359 |         e->counters.blk_read_time += INSTR_TIME_GET_MILLISEC(bufusage->blk_read_time);
      |                                                                        ^~~~~~~~~~~~~
/usr/include/postgresql/17/server/portability/instr_time.h:126:19: note: in definition of macro ‘INSTR_TIME_GET_NANOSEC’
  126 |         ((int64) (t).ticks)
      |                   ^
pg_store_plans.c:1359:38: note: in expansion of macro ‘INSTR_TIME_GET_MILLISEC’
 1359 |         e->counters.blk_read_time += INSTR_TIME_GET_MILLISEC(bufusage->blk_read_time);
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~
pg_store_plans.c:1360:73: error: ‘BufferUsage’ has no member named ‘blk_write_time’; did you mean ‘temp_blk_write_time’?
 1360 |         e->counters.blk_write_time += INSTR_TIME_GET_MILLISEC(bufusage->blk_write_time);
      |                                                                         ^~~~~~~~~~~~~~
/usr/include/postgresql/17/server/portability/instr_time.h:126:19: note: in definition of macro ‘INSTR_TIME_GET_NANOSEC’
  126 |         ((int64) (t).ticks)
      |                   ^
pg_store_plans.c:1360:39: note: in expansion of macro ‘INSTR_TIME_GET_MILLISEC’
 1360 |         e->counters.blk_write_time += INSTR_TIME_GET_MILLISEC(bufusage->blk_write_time);
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~
pg_store_plans.c: In function ‘pg_store_plans_internal’:
pg_store_plans.c:1684:9: warning: implicit declaration of function ‘tuplestore_donestoring’; did you mean ‘tuplestore_rescan’? [-Wimplicit-function-declaration]
 1684 |         tuplestore_donestoring(tupstore);
      |         ^~~~~~~~~~~~~~~~~~~~~~
      |         tuplestore_rescan
make[4]: *** [<builtin>: pg_store_plans.o] Error 1
make[4]: Leaving directory '/home/vagrant/pigsty-deb/pg-store-plan/build'
### End 17 loop (FAILED with exit code 2) ###
make[3]: *** [debian/rules:18: override_dh_auto_install] Error 2
make[3]: Leaving directory '/home/vagrant/pigsty-deb/pg-store-plan/build'
make[2]: *** [debian/rules:21: binary] Error 2
make[2]: Leaving directory '/home/vagrant/pigsty-deb/pg-store-plan/build'
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
make[1]: *** [Makefile:17: build] Error 2
make[1]: Leaving directory '/home/vagrant/pigsty-deb/pg-store-plan'
make: *** [Makefile:136: pg_store_plan] Error 2
@cnaktrk
Copy link

cnaktrk commented Jan 6, 2025

when will it be fixed?

@devrimgunduz
Copy link
Contributor

ping

@devrimgunduz
Copy link
Contributor

Attached patch fixes the problem.

pg_store_plans-pg17.patch.txt

@rjuju rjuju self-assigned this Jan 17, 2025
@rjuju
Copy link
Collaborator

rjuju commented Jan 17, 2025

Thanks for the patch @devrimgunduz . It seems that the maintainers are not around anymore so I will try to help since I got a commit bit some time ago. I will be in an airplane for most of tomorrow so I hope I can get back to it on sunday.

@devrimgunduz
Copy link
Contributor

@rjuju thank you very much!

@rjuju
Copy link
Collaborator

rjuju commented Jan 17, 2025

I see that you pushed the patch on pgrpms, you should probably wait a bit before pushing the rpms, as the resulting extension could be subtly broken. I was looking at what else would need updating, and I was this part https://github.com/ossc-db/pg_store_plans/blob/master/pgsp_json.c#L33-L59

On a freshly compiled pg17 I see that CURRENT_CATALOG is now 359, so this symbol and all the one after is changed so definitely some code would not behave the same (although it should only be whitespace differences). I will also tweak this part to make sure that you can't support a new version without providing new symbols to avoid this kind of problem in the future. I will keep looking at other possible problems.

@devrimgunduz
Copy link
Contributor

Thanks a lot! Reverted.

@rjuju
Copy link
Collaborator

rjuju commented Jan 18, 2025

Quick update, I found a bug when pg_store_plans is compiled against pg15 or below (WIP at e4942b6).

I was able to finally run the regression test successfully against all branches up to pg16 locally with yet another fix for some other problem. I hope that with Christoph's patch to cleanup the github workflow I will be able to make it work here too.

@devrimgunduz
Copy link
Contributor

Hi @rjuju ,

Any news?

Cheers, Devrim

@glushakov
Copy link

Hi, we are also waiting for support for version 17
Thanks

@rjuju
Copy link
Collaborator

rjuju commented Feb 2, 2025

@devrimgunduz sorry it took me a bit of time to get back to it. I unfortunately have limited time and I also have the powa project to take care of where I receive little help.

Anyway, now that the CI was green it revealed another issue: the json lexing changed in postgres 17 and as-is nothing at all was working. I took care of it and some other issues and HEAD should now be compatible with postgres 17, with a green CI.

Let me know if you find any problem.

@theory
Copy link

theory commented Feb 3, 2025

Can confirm that 655864e builds on PostgreSQL 17. Do you plan to make a release? Thanks!

@rjuju
Copy link
Collaborator

rjuju commented Feb 6, 2025

Thanks for the confirmation @theory.

I don't know if I have enough permission for a release but I will try. But I'd like to wait for the known bugs to be fixed first. There are a couple of pull requests opened for that, I reviewed them and I'm waiting for the authors to respond.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants