i am create custom_variable_class= myapp in postgresql.conf. And set the value is inside of function like
CREATE OR REPLACE FUNCTION fn_purchase(xmode text, xuserno integer)
RETURNS text AS
set myapp.user_no=xuserno
..........
..........
END;
Now i am using myapp.user in my trigger
CREATE OR REPLACE FUNCTION public.delete_history()
RETURNS trigger AS
$BODY$
DECLARE userno text;
BEGIN
SELECT current_setting('myapp.user_no') into userno;
END;
$BODY$
If set userno is integer then it show error message.
invalid input syntax for integer: "xuserno".
and
SELECT current_setting('myapp.user_no') is show xuserno not xuserno value. That means xuserno=5 it show xuserno not 5. I am doing any thing wrong?
PERFORM set_config('myapp.user_no', xuserno::text, 'f'::boolean)instead ofSET.myapp.user-no1that time it show errorunrecognized configuration parameter myapp.user_no. what i am doing wrong.......is not valid PL/PgSQL). Or just use theTEMPORARY TABLEapproach.'f'::booleancan be writtenfalse? Seems a lot more readable...