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

BUG #1610: rewrite rule and sequence

From: "Olleg Samoylov" <olleg(at)mipt(dot)ru>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1610: rewrite rule and sequence
Date: 2005-04-21 12:19:44
Message-ID: 20050421121944.15E03F0B53@svr2.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-docs
The following bug has been logged online:

Bug reference:      1610
Logged by:          Olleg Samoylov
Email address:      olleg(at)mipt(dot)ru
PostgreSQL version: 7.4.7
Operating system:   Linux debian-amd64
Description:        rewrite rule and sequence
Details: 

Rule on view can't insert in table with "serial" field under not owner. Need
grant privilege on sequence explicitly.

How reproduce:

olleg=> create table f (pk serial, f integer);
NOTICE:  CREATE TABLE will create implicit sequence "f_pk_seq" for "serial"
column "f.pk"
CREATE TABLE
olleg=> create view v as select * from t;
ERROR:  relation "t" does not exist
olleg=> drop table f;
DROP TABLE
olleg=> create table t (pk serial, f integer);
NOTICE:  CREATE TABLE will create implicit sequence "t_pk_seq" for "serial"
column "t.pk"
CREATE TABLE
olleg=> create view v as select * from t;
CREATE VIEW
olleg=> create rule r as on insert to v do instead insert into t(f) values
(new.f);
CREATE RULE
olleg=> grant select,insert on t to bill;
GRANT
olleg=> \c - bill
You are now connected as new user "bill".
olleg=> insert into t (f) values (0);
ERROR:  permission denied for sequence t_pk_seq

Responses

pgsql-docs by date

Next:From: Richard HuxtonDate: 2005-04-21 15:57:51
Subject: Re: BUG #1610: rewrite rule and sequence
Previous:From: Euler Taveira de OliveiraDate: 2005-04-13 17:09:47
Subject: Re: Translate Postgresql FAQ into Chinese

pgsql-bugs by date

Next:From: Ingolf KnopfDate: 2005-04-21 12:32:16
Subject: BUG #1611: reading a date-field by "ResultSet.getTimestamp()" method analized dayligth flag
Previous:From: Oliver SiegmarDate: 2005-04-21 07:10:02
Subject: Re: BUG #1609: Bug in interval datatype for 64 Bit timestamps

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