Skip to content

PostgresCallMetaDataProvider should detect current schema as indicated by the JDBC Connection #28723

Closed
@hyukchan

Description

@hyukchan

Hi,

I have issues trying to call a stored procedure using postgresql database through a SimpleJdbcCall.

I set the current schema to use with the parameter currentSchema inside jdbcUrl parameter like this:

jdbc:postgresql://localhost:5455/userdb?currentSchema=customschema

"Standard" queries such as jdbcTemplate.query(...) use the correct schema which is customschema.

Though when I try to call a stored procedure through SimpleJdbcCall, it uses the default postgres schema public.

new SimpleJdbcCall(jdbcTemplate).withFunctionName("custom_stored_procedure_name").execute();

I know I can force the use of customschema on each call with .withSchemaName("customschema"), but I shouldn't need to do this.

While debugging, if I look at jdbcTemplate.getDataSource().getConnection().getSchema(), it returns the correct schema which is "customschema".

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions