Skip to content

Errors when compiling 1.6.4 against PostgreSQL 15 #412

Closed

Description

@danielgustafsson

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.

Activity

  1. changed the title [-]Compiling 1.6.4 against PostgreSQL 15[/-] [+]Errors when compiling 1.6.4 against PostgreSQL 15[/+] on Oct 20, 2022
  2. caseylai commented on Nov 10, 2022

    @caseylai

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

  3. kjraman commented on Nov 14, 2022

    @kjraman

    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.

  4. caseylai commented on Nov 14, 2022

    @caseylai

    @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).

  5. yevon commented on Nov 14, 2022

    @yevon

    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).

  6. yevon commented on Nov 14, 2022

    @yevon

    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

  7. fmbiete commented on Nov 15, 2022

    @fmbiete
    Contributor

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

  8. jcflack commented on Jun 5, 2023

    @jcflack
    Contributor

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

  9. jcflack commented on Jun 14, 2023

    @jcflack
    Contributor

    Believed resolved in 1.6.5.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions