Vivek Khera <vivek@xxxxxxxxx> writes: > CREATE OR REPLACE FUNCTION setlogtime(integer) RETURNS void AS $$ > SET log_min_duration_statement = $1; > SHOW log_min_duration_statement; > $$ LANGUAGE SQL SECURITY DEFINER; > How can I write this function? Use a plpgsql EXECUTE command. In general, utility statements don't cope with parameters, because that's a planner/executor facility and utility statements don't go through that. So you've got to substitute the value you want into the text of the command that's submitted. regards, tom lane