Search code examples
postgresqlreactivequarkus

How to select Postgres schema with reactive datasource in Quarkus


I am trying to select a non-default PostgreSQL schema when using a reactive datasource with Quarkus. I tried a syntax similar to the working "regular", non-reactive datasource using ?currentSchema:

quarkus.datasource.url=jdbc:postgresql://host/database?currentSchema=int

like follows:

quarkus.datasource.reactive.url=postgresql://host/database?currentSchema=int

However, it does not have any effect, the default schema is always used.

How can I achieve selecting a PostgreSQL schema for a reactive datasource?


Solution

  • I have the same problem. As a workaround I helped myself by changing the search_path for the user:

    ALTER ROLE readonly IN DATABASE "quarkus"
        SET search_path TO newSchema;