pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Braum Meakes <braum@telus.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: User Permissions
Date: Thu, 17 Jan 2002 19:21:43 -0500
Message-ID: <1617.1011313303@sss.pgh.pa.us> (raw)
In-Reply-To: <5.1.0.14.0.20020117141918.00a49e80@pop.telus.net>
References: <5.1.0.14.0.20020117141918.00a49e80@pop.telus.net>

Braum Meakes <braum@telus.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



view thread (8+ messages)  latest in thread

Message-ID: <1617.1011313303@sss.pgh.pa.us>
Permalink:  ../1617.1011313303@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1617.1011313303@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, braum@telus.net
  Subject: Re: User Permissions
  In-Reply-To: <1617.1011313303@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox