Skip site navigation (1) Skip section navigation (2)

Re: BUG #2278: problem with grants

From: Richard Huxton <dev(at)archonet(dot)com>
To: Tomasz Kliczak <tklimczak(at)atsisa(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2278: problem with grants
Date: 2006-02-22 13:15:30
Message-ID: 43FC63F2.6080807@archonet.com (view raw or flat)
Thread:
Lists: pgsql-bugs
Tomasz Kliczak wrote:
>   CONSTRAINT sy_task_priority FOREIGN KEY (sy_b_id)
>       REFERENCES sy_b (id) MATCH SIMPLE

> When i try to add something into table  dt_a I get error :
> 
> ERROR: permission denied for relation sy_task_priority
> CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"."sy_b" x WHERE "id" = $1
> FOR UPDATE OF x"
> 
> I want to have constraint on table dt_a, and for table sy_b only SELECT
> grant.
> But when I add UPDATE grant on sy_b it works.

That's because the foreign-key takes a lock to *prevent* updates. To do 
this it takes an update lock though, which is why you see the error message.

HTH
-- 
   Richard Huxton
   Archonet Ltd

In response to

pgsql-bugs by date

Next:From: Richard HuxtonDate: 2006-02-22 13:17:47
Subject: Re: Pg-restore
Previous:From: Richard HuxtonDate: 2006-02-22 13:09:50
Subject: Re: Need Help

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group