Re: User Permissions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Braum Meakes <braum(at)telus(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: User Permissions
Date: 2002-01-18 00:21:43
Message-ID: 1617.1011313303@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Braum Meakes <braum(at)telus(dot)net> 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Eisentraut 2002-01-18 00:29:44 Re: User Permissions
Previous Message Doug Royer 2002-01-18 00:05:35 Re: [ANNOUNCE] Commercial: New Book!! PostgreSQL book is