X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9FBCA3A4E86 for ; Fri, 7 Jan 2005 16:54:33 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 15126-02 for ; Fri, 7 Jan 2005 16:54:12 +0000 (GMT) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.202.64]) by svr1.postgresql.org (Postfix) with ESMTP id C83FC3A4ED2 for ; Fri, 7 Jan 2005 16:54:12 +0000 (GMT) Received: from dell8200 (pcp05158174pcs.rte20201.de.comcast.net[69.139.132.79]) by comcast.net (sccrmhc13) with SMTP id <200501071654110160023pr8e>; Fri, 7 Jan 2005 16:54:11 +0000 From: "Rick Schumeyer" To: Subject: simulating row ownership Date: Fri, 7 Jan 2005 11:52:07 -0500 Message-ID: <001901c4f4d9$395726f0$0200a8c0@dell8200> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_001A_01C4F4AF.50811EF0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200501/24 X-Sequence-Number: 19812 This is a multi-part message in MIME format. ------=_NextPart_000_001A_01C4F4AF.50811EF0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable 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. =20 What is the best way to accomplish this? I'm not real familiar with = rules, but it seems that I can do this with rules for update and delete applied to the = table. Someone had suggesting using views, but since I can't update a view in postgres, = I'm not sure that views help here. =20 I assume if I use rules, then I need to grant all to public, and let the rules prevent users from updating the wrong rows? =20 Any advice is appreciated. =20 ------=_NextPart_000_001A_01C4F4AF.50811EF0 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

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 is the best way to accomplish this?  = I’m not real familiar with rules, but it seems

that I can do this with rules for update and delete = applied to the table.  Someone

had suggesting using views, but since I can’t = update a view in postgres, I’m

not sure that views help here.

 

I assume if I use rules, then I need to grant all to = public, and let the rules prevent

users from updating the wrong rows?

 

Any advice is appreciated.

 

------=_NextPart_000_001A_01C4F4AF.50811EF0--