Re: grant permissions to set variable? - Mailing list pgsql-general

From Tom Lane
Subject Re: grant permissions to set variable?
Date
Msg-id 27155.1173900446@sss.pgh.pa.us
Whole thread Raw
In response to Re: grant permissions to set variable?  (Vivek Khera <vivek@khera.org>)
List pgsql-general
Vivek Khera <vivek@khera.org> 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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: How to write a function that manipulates a set of results
Next
From: Magnus Hagander
Date:
Subject: Re: DST problem on Windows Server