I expect to spend time cleaning up e-commerce this weekend, too, since I'll be setting it up for a friend's business so he can start customizing it (he's an experienced hacker, no worries).
<p>
The second bug probably stems from either of these:
<ul><li>Postgres doesn't allow one to pass NULLs into PL/pgSQL functions, weird things happen if you do
<li>Oracle very incorrectly treats the empty string '' as a synonmym for NULL. Postgres correctly treats it as, well, the empty string. This is a subtle porting issue that's easy to overlook when one hacks through the code modifying queries.
</ul>
Take your choice. Maybe it's a combination of both.