Re: IFNULL -> COALESCE - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject Re: IFNULL -> COALESCE
Date
Msg-id 20020209011111.J14715-100000@houston.familyhealth.com.au
Whole thread Raw
In response to IFNULL -> COALESCE  (Lee Kindness <lkindness@csl.co.uk>)
Responses Re: IFNULL -> COALESCE
List pgsql-hackers
> Guys, I've recently being going back over code from Ingres and porting
> it over to PostgreSQL. Heavy use was made of the IFNULL function, this
> function simply returns the 2nd argument if the first is
> NULL. Consider the following query:
>
>  SELECT COALESCE(MAX(id), 0) + 1 from test;
>
> can be replaced by the following PostgreSQL query:
>
>  SELECT COALESCE(MAX(id), 0) + 1 from test;

Ummm...did you make a mistake here?  Those statements are identical...

Chris



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Summary of new configuration file and data directory
Next
From: Tom Lane
Date:
Subject: Re: GiST on 64-bit box