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

Re: [INTERFACES] A question on triggers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Constantin Teodorescu <teo(at)flex(dot)ro>
Cc: Ed Loehr <eloehr(at)austin(dot)rr(dot)com>, PostgreSQL Interfaces <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: [INTERFACES] A question on triggers
Date: 2000-02-16 22:13:13
Message-ID: 4624.950739193@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-interfaces
>>>> Is there any chance to restrict the direct updates of any user to the
>>>> "stock" table?
>>>> So that the information in the "stock" table should be updated ONLY by
>>>> those triggers?

> But wouldn't be nice if PostgreSQL could offer a more elegant solution?

Can't you do it with the normal GRANT/REVOKE access-control mechanism?

I'm pretty sure that for rules (views), the access rights for queries
issued within the rule are checked based on the owner of the rule, not
the user who invoked the rule.  Triggers ought to work the same way,
though I haven't tried it.  So you could make the trigger function and
the protected table owned by the same user, and then not grant write
permission on that table to anyone else.

			regards, tom lane

In response to

Responses

pgsql-interfaces by date

Next:From: Bryan WhiteDate: 2000-02-16 22:23:02
Subject: Managing the memory requierments of large query results
Previous:From: Wojtek SobczukDate: 2000-02-16 18:28:18
Subject: ecpg

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