Would the NOTFOUND case be handled within the same function? If so, these functions do not test for the NOTFOUND case. So it looks like I can convert it to a simple select statement. I'll leave the Oracle code as is and make the changes in the PostgreSQL code where applicable.