I work regularly with both Oracle and PostgreSQL, so I recognize the
Oracle-isms in your examples. Since Oracle works perfectly well with
standards-based approaches, I'd highly suggest you avoid the proprietary
versions when possible. So, use coalesce instead of nvl, case instead
of decode, etc.
I had to convert a large application from Oracle to PostgreSQL. I
assumed I'd have to have a large number of code sections that used
conditionals: if (Oracle) do this, else do that. However, I was
pleasantly surprised to see that after I replaced all the proprietary
functions you show above with the standard alternatives, I had no
conditionals at all!
--
Guy Rouillier