On Fri, Jan 07, 2005 at 11:52:07AM -0500, Rick Schumeyer wrote: > I have a table where I want everyone to be able to be able to insert and > select. > > But they should only be able to update and delete rows that they "own". The > table has a column indicating the owner.
What does the owner column refer to? A database user? If so, then you could use a trigger that checks CURRENT_USER or SESSION_USER and raises an exception if the user doesn't have permission to update or delete the affected row. In the PostgreSQL documentation, see the "Triggers" chapter and the "Trigger Procedures" section of the "PL/pgSQL - SQL Procedural Language" chapter. -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend