Re: insert through function only - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: insert through function only
Date
Msg-id 20040503223937.GA29512@wolff.to
Whole thread Raw
In response to insert through function only  (Marvin McNett <mmcnett@cs.ucsd.edu>)
Responses Re: insert through function only  (Marvin McNett <mmcnett@cs.ucsd.edu>)
List pgsql-general
On Mon, May 03, 2004 at 15:12:00 -0700,
  Marvin McNett <mmcnett@cs.ucsd.edu> wrote:
> How do I go about ensuring that data is only added to a table through a
> function?  I've tried granting execute persission on the function which
> inserts data, but can't get it to work unless the user also has insert
> permission on the table.  I don't want the user to be able to
> arbitrarily insert data.

You need to use SECURITY DEFINER so that the function runs with the
access of its definer instead of its invoker.

pgsql-general by date:

Previous
From: Marvin McNett
Date:
Subject: insert through function only
Next
From: Marvin McNett
Date:
Subject: Re: insert through function only