Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2P0oKw35215 for ; Sat, 24 Mar 2001 19:50:20 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f2P0o0w10011; Sat, 24 Mar 2001 19:50:01 -0500 (EST) To: Andrew Perrin cc: pgsql-sql@postgresql.org Subject: Re: all views in database broken at once In-reply-to: References: Comments: In-reply-to Andrew Perrin message dated "Sat, 24 Mar 2001 19:31:55 -0500" Date: Sat, 24 Mar 2001 19:50:00 -0500 Message-ID: <10008.985481400@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200103/483 X-Sequence-Number: 2154 Andrew Perrin writes: > But I'm intrigued: what is it that causes this? Is it *my* > recreating the view on which the other views depend, Yes. You dropped and recreated the view --- the new version may have the same name but it's not the same OID, so it isn't the same object. And the other views refer to it by OID. The ultimate solution should have two parts, IMHO: 1. Dependency checking so that you *can't* drop a view that is still referenced. However this will not be complete --- it's not clear that we can detect references inside PL functions, for example. 2. An ALTER VIEW command that lets you change a view's defining query, while keeping the same OID, as long as the names and types of the output columns don't change. This would reduce the need to drop and recreate views. regards, tom lane