Q: PostgreSQL: mkdir with plpgsql I am creating a procedure using plpgsql which calls a .bat file. This same .bat file manipulates files and directories (includes mkdir, rmdir...) but these commands are not being executed. I was reading that plpgsql is only for data manipulation -- so I am presuming this is the issue. 
How can I work around this problem? Can I set some parameter to remove this restriction, use a new language, or what? 

A: You should write the function in an untrusted language, e.g. PL/PythonU. 
For the documentation::

Trusted languages are designed for ordinary database users (those without superuser privilege) and allows them to safely create functions and trigger procedures. Since PL functions are executed inside the database server, the TRUSTED flag should only be given for languages that do not allow access to database server internals or the file system. The languages PL/pgSQL, PL/Tcl, and PL/Perl are considered trusted; the languages PL/TclU, PL/PerlU, and PL/PythonU are designed to provide unlimited functionality and should not be marked trusted.

