=?ISO-8859-1?Q?Hans-J=FCrgen_Sch=F6nig?= <postgres(at)cybertec(dot)at> writes:
> question is: How do I find out when a query starts? Inside a table
> function I can call SRF_IS_FIRSTCALL() to see when it is called first.
> Is there an easy way to check that inside an "ordinary" C function
> returning just one value?
Use fn_extra to store some state data.
pg_stat_get_backend_idset() is a useful example.
regards, tom lane