plsh icon indicating copy to clipboard operation
plsh copied to clipboard

Calling a binary that has access to the database

Open benintech opened this issue 8 years ago • 1 comments

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 ?

benintech avatar Jan 31 '17 16:01 benintech

Maybe because sogo-tool writes something to stderr? Try with 2>/dev/null or similar.

petere avatar Feb 13 '17 01:02 petere