using double quotes in sc_exec_sql

Hello to all,

I need to define a session variable in postgres, for them I try to set it using sc_exec_sql(“set session “usrapp” = ‘{usuario}’”); but I get the next error : pg_query(): Query failed: ERROR: unrecognized configuration parameter “usrapp” obviusly the problem is the double quotes.

How can I use double quotes in sc_exec_sql sentence ? I tryed " “” “”"’

best regards

Marcelo V?a

A simple solution split it up…
$command="set session “+’“usrapp”’+” = ‘{usuario}’;
sc_exec_sql($command);
It is php so you can do it in steps…

Hello, I think the problem is not the quotes, the problem is the variable name, I got the sc_exec_sql work whit other variable name, like my.username. What I want and need is to capture the user application to use it in a audit trigger, first I set the session variable (login app) with set session "my.username=‘name’ " and in the trigger I try to catch it with
SELECT current_setting(‘my.username’) but I only get a blank string, I think that SC open a unique session when start a project or application, somebody have an idea about it regards Marcelo