Forum OpenACS Q&A: Response to Postgres Functions only work in PSQL, not through aolserver

How are you getting the results of these queries? If you are using the popular "set_variables_after_query", then you need to rephrase your query to give the function calls names.

For example:

set db [ns_db gethandle]

set selection [ns_db 1row $db "SELECT initcap(first_name) as cap_first_name, 
initcat(last_name) as cap_last_name 
from  sometable"]

set_variables_after_query
ns_write "$cap_first_name $cap_last_name"
If you don't give them names, it set_variables_after_query will give them different names.