Skip to content

PgRouting/pgr_dijkstra: How to log output, i.e raising a notice message after every 100, 500, 0r 1.000 calculated routes or so. #2339

Answered by cvvergara
adeways2000 asked this question in Q&A
Discussion options

You must be logged in to vote

What is been asked for

It can not be done due to the way postgres function works:
https://www.postgresql.org/docs/current/xfunc-c.html#XFUNC-C-RETURN-SET
Basically what is says in pseudo code where pgRouting (nor any extension/function coded with C) does not have control over what the SRF_ postgres macros.

fn (data) {
if (SRF_IS_FIRSTCALL()) {
  calculate result
  save result in memory
  save row number to output in memory
}
retrieve result from memory
funcctx = SRF_PERCALL_SETUP();
get row number to output
if (funcctx->call_cntr < funcctx->max_calls) {
   prepare output row
   SRF_RETURN_NEXT(funcctx, result);
} else {
  SRF_RETURN_DONE(funcctx);
}
}

So when a SELECT * FROM fn id done
f…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@adeways2000
Comment options

Answer selected by adeways2000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants