Re: C vs. C++ contributions - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: C vs. C++ contributions
Date
Msg-id 200208291832.g7TIWVG13928@candle.pha.pa.us
Whole thread Raw
In response to Re: C vs. C++ contributions  (Mario Weilguni <mweilguni@sime.com>)
Responses Re: C vs. C++ contributions  (Mario Weilguni <mweilguni@sime.com>)
List pgsql-hackers
Mario Weilguni wrote:
> Yes this is completly different. Oracle decode works like this:
> 
> decode(value, choice1, result1, choice 2, result2, ......,
> default_result)
> 
> it works this way:  case
>   when value=choice1 then result1 when value=choice2 then result2
>   ....
>   else default_result end

Yes, it would be nice to be able turn these on just for portability with
Oracle queries.

> The nice part is it has an varying number of arguments, and can
> used within "sort". Very useful sometimes.

With our CASE, you create a column using the CASE, then ODER BY on that
column.

> Another one very useful oracle function is "nvl", the same like
> "coalesce", but a lot easier to write :-)

Yes, another nice portability thing if it could be enabled/disabled.

-- Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Gavin Sherry
Date:
Subject: Re: Musings
Next
From: Bruce Momjian
Date:
Subject: Re: [Resend] Sprintf() auditing and a patch