Richard Yen <richyen(at)iparadigms(dot)com> wrote:
> Ah, I see what you mean. If there's no rows to return, then there's no coalesce-ing to do...
That's right, /but/ if you use a sub-select, you can achieve
something similar:
| tim=# SELECT COALESCE((SELECT ROUND(EXTRACT(epoch FROM now() - query_start))
| tim(# FROM pg_stat_activity
| tim(# WHERE current_query = '<IDLE> in transaction'),
| tim(# 0);
| coalesce
| ----------
| 0
| (1 Zeile)
| tim=#
> sorry for the spam.
> [...]
That wasn't spam :-).
Tim