public inbox for [email protected]  
help / color / mirror / Atom feed
From: Olleg Samoylov <[email protected]>
To: [email protected]
Subject: BUG #1610: rewrite rule and sequence
Date: Thu, 21 Apr 2005 13:19:44 +0100 (BST)
Message-ID: <[email protected]> (raw)


The following bug has been logged online:

Bug reference:      1610
Logged by:          Olleg Samoylov
Email address:      [email protected]
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



view thread (5+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: BUG #1610: rewrite rule and sequence
  In-Reply-To: <[email protected]>

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

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