Re: grant permissions to set variable?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vivek Khera <vivek(at)khera(dot)org>
Cc: pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: grant permissions to set variable?
Date: 2007-03-14 19:27:26
Message-ID: 27155.1173900446@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Vivek Khera <vivek(at)khera(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2007-03-14 19:39:17 Re: DST problem on Windows Server
Previous Message Tom Lane 2007-03-14 19:25:15 Re: How to write a function that manipulates a set of results