Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0I0LgV46395 for ; Thu, 17 Jan 2002 19:21:42 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g0I0Lh301620; Thu, 17 Jan 2002 19:21:44 -0500 (EST) To: Braum Meakes cc: pgsql-sql@postgresql.org Subject: Re: User Permissions In-reply-to: <5.1.0.14.0.20020117141918.00a49e80@pop.telus.net> References: <5.1.0.14.0.20020117141918.00a49e80@pop.telus.net> Comments: In-reply-to Braum Meakes message dated "Thu, 17 Jan 2002 14:27:39 -0800" Date: Thu, 17 Jan 2002 19:21:43 -0500 Message-ID: <1617.1011313303@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200201/208 X-Sequence-Number: 6294 Braum Meakes writes: > I have a function that I've written in plpgsql. In it I lock a table > before selecting a value and, depending on the value, either update the > record selected or insert a new one. It works perfectly when I run it as a > super-user or as the owner of the table. However, as a standard user I am > unable to lock the table. [ eyeballs code ] LOCK ... IN ACCESS SHARE MODE (ie, read lock) requires SELECT privileges; all stronger forms of LOCK require UPDATE and/or DELETE privileges. This seems to be undocumented :-(. Am fixing the LOCK reference page now. Per subsequent discussion, it's not real clear that you need LOCK at all ... but the docs need to explain the privilege rules, since they're not exactly obvious. regards, tom lane