Hmmm, yeah.
I looked around for what you mentioned, doesn't seem Postgre supports the Oracle equivalent as I went through all the functions. However it does allow you to create custom functions using PL/pgSQL as Oracle (I believe) does.
So either that or your suggestion would work as well...