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

view OIDs

From: "David M(dot) Kaplan" <dmkaplan(at)ucdavis(dot)edu>
To: pgsql-bugs(at)postgresql(dot)org
Subject: view OIDs
Date: 2002-06-25 22:14:18
Message-ID: 3D18EB3A.1050507@ucdavis.edu (view raw or flat)
Thread:
Lists: pgsql-bugs
Hi,

I use a lot of views in my DB, many of whom depend on each other (ie 
views of views).  When I alter one of the subviews, all the views that 
depend on it fail.  Postgres complains that the view with the old OID no 
longer exists.  The fix is to drop and create all views that depend on 
the altered view.  This can get really tedious.

Is there any fix for this?

If there isnt, I was thinking of trying to implement something.  I can 
think of several possible solutions:

1) Allow users to create views with particular OID's.  For example 
something like CREATE VIEW WITH OID=....  Seems like the simplest solution.

2) On using views that depend on a subview that has changed, if OID 
fails, fallback to view name and use that.  It seems that postgres is 
aware that another view with the same name exists, as the error is 
different in this case than if the view is simply absent.  This would 
solve the problem, but it would be nice to update the OIDs somehow.

3) Upon creating a view with a certain name, make all views that depend 
on it point to it with the correct OID.

David Kaplan





Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2002-06-25 22:28:46
Subject: Re: Bug #698: Error haciendo Backup con pg_dump!!
Previous:From: pgsql-bugsDate: 2002-06-25 18:42:01
Subject: Bug #698: Error haciendo Backup con pg_dump!!

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