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

Errors when compiling 1.6.4 against PostgreSQL 15 #412

Closed
danielgustafsson opened this issue Oct 20, 2022 · 8 comments
Closed

Errors when compiling 1.6.4 against PostgreSQL 15 #412

danielgustafsson opened this issue Oct 20, 2022 · 8 comments

Comments

@danielgustafsson
Copy link

danielgustafsson commented Oct 20, 2022

When compiling PL/Java 1.6.4 against PostgreSQL 15.0 I get (many instances of) the below error:

[INFO] Using compiling/linking rules for Linux
In file included from /home/builder/rpmbuild/BUILD/pljava-1_6_4/pljava-so/src/main/c/Backend.c:59:
/home/builder/rpmbuild/BUILD/pljava-1_6_4/pljava-so/src/main/include/pljava/type/String.h:32:25: error: conflicting types for ‘String’
 typedef struct String_* String;
                         ^~~~~~
In file included from /opt/foo/postgres/15/include/server/nodes/parsenodes.h:28,
                 from /opt/foo/postgres/15/include/server/utils/guc.h:16,
                 from /opt/foo/postgres/15/include/server/access/tableam.h:23,
                 from /opt/foo/postgres/15/include/server/commands/trigger.h:16,
                 from /opt/foo/postgres/15/include/server/executor/spi.h:16,
                 from /home/builder/rpmbuild/BUILD/pljava-1_6_4/pljava-so/src/main/c/Backend.c:19:
/opt/foo/postgres/15/include/server/nodes/value.h:61:3: note: previous declaration of ‘String’ was here
 } String;
   ^~~~~~

As well as these:

/home/builder/rpmbuild/BUILD/pljava-1_6_4/pljava-so/src/main/c/type/Type.c: In function ‘TypeClass_alloc2’:
/home/builder/rpmbuild/BUILD/pljava-1_6_4/pljava-so/src/main/c/type/Type.c:1084:26: warning: cast between incompatible function types from ‘void (*)(struct PgObject_ *)’ to ‘jvalue (*)(struct Type_ *, Datum)’ {aka ‘union jvalue (*)(struct Type_ *, long unsigned int)’} [-Wcast-function-type]
  self->coerceDatum     = (DatumCoercer)_PgObject_pureVirtualCalled;
                          ^
/home/builder/rpmbuild/BUILD/pljava-1_6_4/pljava-so/src/main/c/type/Type.c:1085:26: warning: cast between incompatible function types from ‘void (*)(struct PgObject_ *)’ to ‘Datum (*)(struct Type_ *, struct _jobject *)’ {aka ‘long unsigned int (*)(struct Type_ *, struct _jobject *)’} [-Wcast-function-type]
  self->coerceObject    = (ObjectCoercer)_PgObject_pureVirtualCalled;
                          ^
/home/builder/rpmbuild/BUILD/pljava-1_6_4/pljava-so/src/main/c/type/Type.c: In function ‘Type_registerType’:
/home/builder/rpmbuild/BUILD/pljava-1_6_4/pljava-so/src/main/c/type/Type.c:1176:3: warning: cast between incompatible function types from ‘void (*)(struct PgObject_ *)’ to ‘struct Type_ * (*)(Oid)’ {aka ‘struct Type_ * (*)(unsigned int)’} [-Wcast-function-type]
   (TypeObtainer)_PgObject_pureVirtualCalled);
   ^

This particular compilation was against openjdk-latest on RHEL8 which is Java 19.

@danielgustafsson danielgustafsson changed the title Compiling 1.6.4 against PostgreSQL 15 Errors when compiling 1.6.4 against PostgreSQL 15 Oct 20, 2022
@caseylai
Copy link

Same issue here. Currently the only way is downgrade PostgreSQL to 14.

@kjraman
Copy link

kjraman commented Nov 14, 2022

Hi @caseylai

Are you able to complete the mvn build?

I'm using docker and having the same issue.
I tried with PostgreSQL 13 and 15 . Same issue.
openjdk-11 is not availble. the least version available is openjdk-17. Still same issue.

If someone help to overcome this it is highly appreciated.

@caseylai
Copy link

@kjraman I completed the mvn build with PostgreSQL 14.6 and PL/Java 1.6.4 (OpenJDK 11 and 17 both okay) following the build tutorial. But failed with PG 15 (including 15.0 and 15.1).

@yevon
Copy link

yevon commented Nov 14, 2022

Really interested in this also, as I'm unable to make it to work with postgresql 15. I think that this is due to the strict type verifications of postgresql 15, as char and text are treated differently, I came with this issue in other libraries too (PostgREST).

@yevon
Copy link

yevon commented Nov 14, 2022

I'm not very used to maven, could somebody help me to check why my build is failing?

What I did:

  1. Clone repo
  2. Install all required compile tools, and postgresql 15
  3. Executed: mvn compile -X in the root of the project

Errors received:

[ERROR] Failed to parse plugin descriptor for org.postgresql:pljava-pgxs:1.6.4 (/mnt/c/Users/gabri/Documents/Proyectos/Education/library-pl-java/pljava-pgxs/target/classes): No plugin descriptor found at META-INF/maven/plugin.xml -> [Help 1]

image

@fmbiete
Copy link
Contributor

fmbiete commented Nov 15, 2022

1.6.4 is not compatible with PostgreSQL v15, to make it build you need to apply the changes proposed in #413

@jcflack
Copy link
Contributor

jcflack commented Jun 5, 2023

Pull request #437 has been merged, to appear in the next release.

@jcflack
Copy link
Contributor

jcflack commented Jun 14, 2023

Believed resolved in 1.6.5.

@jcflack jcflack closed this as completed Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants