Unix Technical Forum

BUG #1524: drop view cascade deletes other user's views

This is a discussion on BUG #1524: drop view cascade deletes other user's views within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 1524 Logged by: Dennis van Dok Email address: d.vandok@ecn.nl PostgreSQL ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 09:37 AM
Dennis van Dok
 
Posts: n/a
Default BUG #1524: drop view cascade deletes other user's views


The following bug has been logged online:

Bug reference: 1524
Logged by: Dennis van Dok
Email address: d.vandok@ecn.nl
PostgreSQL version: 7.3.4
Operating system: Linux
Description: drop view cascade deletes other user's views
Details:

Using DROP VIEW or DROP TABLE with CASCADE will drop all dependent views,
even those that aren't owned by the caller.

steps to recreate behaviour:

log in as user1
=> create table t1 (col1 integer);
CREATE TABLE

log out. Log in as user2.
=> create view v1 as select * from t1;
CREATE VIEW

Note that at this point, user1 can not drop v1, nor select from it, while
user2 cannot select from either t1 or v1.

Log out, and log in again as user1
=> drop table t1 cascade;
NOTICE: Drop cascades to rule _RETURN on view v1
NOTICE: Drop cascades to view v1
DROP TABLE

Poof.

Now, I realize that user1 SHOULD be able to drop his own table, no matter
what. But it seems awfully unpolite to pull the view from under user2's nose
like that, even if it has become disfunctional after dropping t1.

We happen to be in a situation where one user is managing a 'master view'
for a data aquisition system, listing all signals as fields. Other users
derive their own (elaborate) views from it. Whenever the master view is
updated, all their hard work is send into limbo.

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 09:37 AM
Tom Lane
 
Posts: n/a
Default Re: BUG #1524: drop view cascade deletes other user's views

"Dennis van Dok" <d.vandok@ecn.nl> writes:
> Using DROP VIEW or DROP TABLE with CASCADE will drop all dependent views,
> even those that aren't owned by the caller.


This is per SQL spec.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:51 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com