pljava icon indicating copy to clipboard operation
pljava copied to clipboard

PostgreSQL 17 support

Open crunchyjohn opened this issue 1 year ago • 1 comments

Hello!

I would like to request pg17 support for pljava.

When I build against PG17 using the latest released version (v1.6.7), I get the following error:

[INFO] ----------------------< org.postgresql:pljava-so >----------------------
[INFO] Building PL/Java backend native code 1.6.7                         [5/8]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ pljava-so ---
[INFO]
[INFO] --- pljava-pgxs:1.6.7:scripted-goal (build-shared-object) @ pljava-so ---
[INFO] Using compiling/linking rules for Linux
pljava-V1_6_7/pljava-so/src/main/c/InstallHelper.c: In function 'pljavaDbName':
pljava-V1_6_7/pljava-so/src/main/c/InstallHelper.c:93:14: warning: implicit declaration of function 'IsAutoVacuumWorkerProcess'; did you mean 'AmAutoVacuumWorkerProcess'? [-Wimplicit-function-declaration]
   93 |         if ( IsAutoVacuumWorkerProcess() || IsBackgroundWorker )
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~
      |              AmAutoVacuumWorkerProcess
pljava-V1_6_7/pljava-so/src/main/c/InstallHelper.c:93:45: error: 'IsBackgroundWorker' undeclared (first use in this function); did you mean 'AmBackgroundWorkerProcess'?
   93 |         if ( IsAutoVacuumWorkerProcess() || IsBackgroundWorker )
      |                                             ^~~~~~~~~~~~~~~~~~
      |                                             AmBackgroundWorkerProcess
pljava-V1_6_7/pljava-so/src/main/c/InstallHelper.c:93:45: note: each undeclared identifier is reported only once for each function it appears in
pljava-V1_6_7/pljava-so/src/main/c/InstallHelper.c: In function 'origUserName':
pljava-V1_6_7/pljava-so/src/main/c/InstallHelper.c:113:45: error: 'IsBackgroundWorker' undeclared (first use in this function); did you mean 'AmBackgroundWorkerProcess'?
  113 |         if ( IsAutoVacuumWorkerProcess() || IsBackgroundWorker )
      |                                             ^~~~~~~~~~~~~~~~~~
      |                                             AmBackgroundWorkerProcess
pljava-V1_6_7/pljava-so/src/main/c/InstallHelper.c: In function 'InstallHelper_shouldDeferInit':
pljava-V1_6_7/pljava-so/src/main/c/InstallHelper.c:357:14: error: 'IsBackgroundWorker' undeclared (first use in this function); did you mean 'AmBackgroundWorkerProcess'?
  357 |         if ( IsBackgroundWorker || IsAutoVacuumWorkerProcess() )
      |              ^~~~~~~~~~~~~~~~~~
      |              AmBackgroundWorkerProcess
pljava-V1_6_7/pljava-so/src/main/c/PgSavepoint.c: In function 'Java_org_postgresql_pljava_internal_PgSavepoint__1rollback':
pljava-V1_6_7/pljava-so/src/main/c/PgSavepoint.c:190:17: warning: implicit declaration of function 'SPI_restore_connection' [-Wimplicit-function-declaration]
  190 |                 SPI_restore_connection();
      |                 ^~~~~~~~~~~~~~~~~~~~~~
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for PostgreSQL PL/Java 1.6.7:
[INFO]
[INFO] PostgreSQL PL/Java ................................. SUCCESS [ 16.476 s]
[INFO] PL/Java API ........................................ SUCCESS [ 10.033 s]
[INFO] PL/Java backend Java code .......................... SUCCESS [  4.775 s]
[INFO] PL/Java PGXS ....................................... SUCCESS [ 12.459 s]
[INFO] PL/Java backend native code ........................ FAILURE [ 10.006 s]
[INFO] PL/Java Ant tasks .................................. SKIPPED
[INFO] PL/Java examples ................................... SKIPPED
[INFO] PL/Java packaging .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  53.821 s
[INFO] Finished at: 2024-09-12T14:01:16-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.postgresql:pljava-pgxs:1.6.7:scripted-goal (build-shared-object) on project pljava-so: Compilation failed with exit code: 1 -> [Help 1]

I am compling on an Alma9 - x86_64 Linux box. I am unsure what changes would be required, so I thought I would raise the issue.

Thanks!

crunchyjohn avatar Sep 12 '24 18:09 crunchyjohn

Hi @jcflack ,

v17 GA is soon. Any chance you can take a look at this please?

Thanks! Devrim

devrimgunduz avatar Sep 23 '24 16:09 devrimgunduz

Hi! Any chance that you could cut a new release of the pljava plugin that has this support?

javsalgar avatar Oct 17 '24 14:10 javsalgar

PL/Java 1.6.8 is released after testing with PostgreSQL 17.

@devrimgunduz, I am sorry we didn't connect at pgconf.dev to discuss the RPM packaging. This release has made some updates in the documentation for packaging PL/Java and what files are produced by a build. Those docs may be enough to suggest improvements to the RPM packaging. If they leave you with unanswered questions, I would be happy to discuss them.

A significant issue that was reported by a PL/Java user last spring was that the RPM package does not seem to install the pljava.policy file.

Leaving that file out of the RPM package can be a source of great frustration (or worse) for a new PL/Java user, because PL/Java 1.6.x definitely will not work without its policy file, and a frustrated user may try to get it working by creating a policy file that grants AllPermission to all code—which is far from desirable.

jcflack avatar Oct 20 '24 02:10 jcflack

@jcflack thanks for the 1.6.8 release! I'll take care of the policy file and other packaging issues ASAP and will let you know.

devrimgunduz avatar Oct 20 '24 05:10 devrimgunduz