Re: C vs. C++ contributions

From: Mario Weilguni <mweilguni(at)sime(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: C vs. C++ contributions
Date: 2002-08-29 06:57:06
Message-ID: 200208290857.06894.mweilguni@sime.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > feature of that type. But random misfeatures such as the join syntax or
> > the decode() function are going to have a hard time getting accepted.
>
> But we have decode():
>
> test=> \df decode
> List of functions
> Result data type | Schema | Name | Argument data types
> ------------------+------------+--------+---------------------
> bytea | pg_catalog | decode | text, text
> (1 row)
>
> Is this a different decode?

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

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

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2002-08-29 07:23:15 #ifdef MULTIBYTE removed
Previous Message Joe Conway 2002-08-29 06:53:55 SRF memory mgmt patch (was [HACKERS] Concern about memory management with SRFs)