I am trying to migrate from SQL Server on windows NT to a Linux server
running Postgres. The table definitions are no problem and the data
migrates well using bcp and COPY. The problem is that most of the
functionality of the client programs were built into stored procedures.
This worked well in that any change of policy or functionality was
propagated immediatly and didn't require update of the clients.

My problem is how to replicate stored procedures. Functions don't work
since I need to return result sets and not single values. Using views, I
can achieve some of the results, however the more involved procedures return
results based on queries (or subqueries).

Review of the documents on postgres.org and google searches don't really
provide any solutions.
Does anyone have any ideas how I might approach this problem?

Thanks in advance.

Al Rosenthal