Skip site navigation (1) Skip section navigation (2)

DML Restriction unless through a function

From: val(at)webtribe(dot)net
To: pgsql-general(at)postgresql(dot)org
Subject: DML Restriction unless through a function
Date: 2004-06-30 12:21:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
Hi all;

Is it possible to write a trigger or the ilk that would disallow 
direct inserts, updates, or deletes to a table unless it was 
being executed through a function?  How can I identify that the 
DML being issued is being done via a function?

We are writing an API of sorts and for various business logic 
aspects, it is necessary that certain checks and sets of data 
are processed through the database in a certain method.  The use 
of functions provides the ability to do this, but I would 
definitely like to restrict access to the under lying tables.

If I revoke insert,update,delete privileges on a table, would 
the user still be able to affect data manipulation through a 
function?  Is that another way of getting around this?



pgsql-general by date

Next:From: Prabu SubrotoDate: 2004-06-30 12:41:36
Subject: mysql2postgres has no documentation?
Previous:From: Leo LeoDate: 2004-06-30 12:02:56
Subject: a few Questions about quoted variables in psql

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group