Re: Setuid functions

From: Joe Conway <mail(at)joeconway(dot)com>
To: Luis Sousa <llsousa(at)ualg(dot)pt>
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Setuid functions
Date: 2003-07-08 16:34:39
Message-ID: 3F0AF29F.4050501@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Luis Sousa wrote:
> How can I set a function as setuid ?
> I take a look at the documetation, on Reference Manual and the only
> reference I saw to it was on SET SESSION AUTHORIZATION.

See:
http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=sql-createfunction.html

CREATE [ OR REPLACE ] FUNCTION name ( [ argtype [, ...] ] )
RETURNS rettype
{ LANGUAGE langname
| IMMUTABLE | STABLE | VOLATILE
| CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT
| [EXTERNAL] SECURITY INVOKER | [EXTERNAL] SECURITY DEFINER
| AS 'definition'
| AS 'obj_file', 'link_symbol'
} ...
[ WITH ( attribute [, ...] ) ]

[EXTERNAL] SECURITY INVOKER
[EXTERNAL] SECURITY DEFINER

SECURITY INVOKER indicates that the function is to be executed with
the privileges of the user that calls it. That is the default. SECURITY
DEFINER specifies that the function is to be executed with the
privileges of the user that created it.

The key word EXTERNAL is present for SQL compatibility but is
optional since, unlike in SQL, this feature does not only apply to
external functions.

HTH,

Joe

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Yasir Malik 2003-07-08 20:07:05 Datatype conversion help
Previous Message Luis Sousa 2003-07-08 16:29:58 Setuid functions