create or replace function foo()
returns table(id integer, name text)
language plpgsql
as $func$
begin
select id, name
from white_house;
end
$func$
Routines.foo()
org.postgresql.util.PSQLException: ERROR: relation "white_house" does not exist
Where: PL/pgSQL function my_schema.foo() line 4 at OPEN
but it also failed.
configuration.set(new Settings().withRenderSchema(true));
Is there any possibility to add the "my_schema" schema prefixes at runtime to the tables inside this foo() function without changing the function? I'm using jOOQ 3.8.5.
SET search_path TO my_schema, public;I hope this helps,
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
set search_path = my_schema;
does the work perfectly.
@Override
public void executeStart(ExecuteContext ctx) {
try {
ctx.connection().prepareStatement("set search path = my_schema;").executeUpdate();
super.executeStart(ctx);
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
I have a suite of identical schemas, roles/logins specific to one schema(default search_path=<role's schema>, public). Functions are public and name tables without schema, relying on caller's search_path.
--