plsh
plsh copied to clipboard
Calling a binary that has access to the database
Hallo,
I try to understand why the following code fails : (sogo-tool is a binary that accesses a PostgreSQL database) CREATE OR REPLACE FUNCTION showSig() RETURNS text AS ' #!/bin/bash LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib/sogo" export LD_LIBRARY_PATH /usr/local/sbin/sogo-tool user-preferences get defaults john.doe SOGoMailSignature ' LANGUAGE plsh;
Within psql : SELECT showSig(); ERROR: showsig:
Directly from the shell, it works : $ /usr/local/sbin/sogo-tool user-preferences get defaults john.doe SOGoMailSignature SOGoMailSignature: "John W. Doe - New York City - USA"
Any idea ?
Maybe because sogo-tool writes something to stderr? Try with 2>/dev/null or similar.