can any of the programming languages (perl, tcl) be used to exec a process on the server and open files? The scenario I have in mind would - copy some fields of a table to an external text file - have a script generate binary data from the text file - load that data into a large object The client would just select rebuild()
Do you want all of the processing to be done on the server side? You need to look into creating an _untrusted_ language such as PL/Tclu, plperlu, or PL/Python (which is always / only untrusted). Those languages allow full access to the TCL, PERL, or Python language, including running other processes (which would run under the postgres UNIX id, not the client's id).