Richard Yen 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(#
Ah, I see what you mean. If there's no rows to return, then there's no
coalesce-ing to do...
sorry for the spam.
--Richard
On Jul 14, 2010, at 5:12 PM, Thom Brown wrote:
> On 15 July 2010 00:52, Richard Yen wrote:
>> Hi everyone,
>>
>> Looks like I'm encountering some quirks with coalesce
On 15 July 2010 00:52, Richard Yen wrote:
> Hi everyone,
>
> Looks like I'm encountering some quirks with coalesce()...
>
>> postgres=# select coalesce(null,0);
>> coalesce
>> --
>> 0
>> (1 row)
>>
>> postgres=# SELECT COALESCE(ROUND(EXTRACT(epoch FROM now()-query_start)),0)
>> F
Hi everyone,
Looks like I'm encountering some quirks with coalesce()...
> postgres=# select coalesce(null,0);
> coalesce
> --
> 0
> (1 row)
>
> postgres=# SELECT COALESCE(ROUND(EXTRACT(epoch FROM now()-query_start)),0)
> FROM pg_stat_activity WHERE current_query = ' in transac