Hi! I'm trying to replicate a common pattern in some Postgres extensions, for example something like:
static void
pgss_ExecutorStart(QueryDesc *queryDesc, int eflags)
{
if (prev_ExecutorStart)
prev_ExecutorStart(queryDesc, eflags);
else
standard_ExecutorStart(queryDesc, eflags);
// use queryDesc
I tried using prev_hook and standard_ExecutorStart but i don't understand fully the pgx flow of hooks, also I always end with errors with the borrow checker because of this:
fn executor_start(
&mut self,
query_desc: PgBox<QueryDesc>,
eflags: i32,
prev_hook: fn(PgBox<QueryDesc>, i32) -> HookResult<()>,
) -> HookResult<()> {
prev_hook(query_desc, eflags)
if query_desc.totaltime.is_null() { // value borrowed here after move blabla
.......
}
If this is the correct place to ask, any help would be appreciate.
Thanks!
Hi! I'm trying to replicate a common pattern in some Postgres extensions, for example something like:
I tried using
prev_hook
andstandard_ExecutorStart
but i don't understand fully the pgx flow of hooks, also I always end with errors with the borrow checker because of this:If this is the correct place to ask, any help would be appreciate. Thanks!