... - Mailing list pgsql-general

From Papp Gyozo
Subject ...
Date
Msg-id Pine.GSO.4.21.0009041853280.8500-100000@ural2
Whole thread Raw
List pgsql-general
I found that
 inserting into a relation (eg. ref) referencing an other table (key)
 as a "granted user" (grant insert on ref to private)
 needs that the user has SELECT and UPDATE permission on the referenced table.

I`d like to know if there is any solution that does not need the UPDATE permission
on key except the owner of these tables. (SELECT permission is not so important.)
(PostgreSQL "7.0.2 on i686-pc-linux-gnu, compiled by gcc 2.95.2" is used.)

Here comes the first session in which the key and ref tables have been created:
try=# \set PROMPT1 '%n%R%#' -- just for see the current_user in prompt
gerzson=#create table key(col integer primary key);
NOTICE:  CREATE TABLE/PRIMARY KEY will create implicit index 'key_pkey' for table 'key'
CREATE
gerzson=#create table ref(col_ref integer references t_key);
NOTICE:  CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
CREATE
gerzson=#grant insert on ref to private;
CHANGE
gerzson=#insert into key values (5);

Here comes an other session trying to insert into ref table an existing value:
private=>insert into ref values (5);
ERROR:  key: Permission denied.



Papp Gyozo

s7461pap@hszk.bme.hu, gerzson17@freemail.hu


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [Solved] SQL Server to PostgreSQL
Next
From: "Zorlac"
Date:
Subject: Re: system catalog question