Re: C vs. C++ contributions

Поиск
Список
Период
Сортировка
От Mario Weilguni
Тема Re: C vs. C++ contributions
Дата
Msg-id 200208290857.06894.mweilguni@sime.com
обсуждение исходный текст
Ответ на Re: C vs. C++ contributions  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: C vs. C++ contributions
Список 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 :-)




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Neil Conway
Дата:
Сообщение: tweaking MemSet() performance
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: #ifdef MULTIBYTE removed