X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8948056545 for ; Tue, 8 Mar 2005 01:17:10 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 74568-02 for ; Tue, 8 Mar 2005 01:17:09 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id EF30C56541 for ; Tue, 8 Mar 2005 01:17:08 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j281H3EA010215 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Mar 2005 18:17:05 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j281H3ts052221; Mon, 7 Mar 2005 18:17:03 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j281H3ki052220; Mon, 7 Mar 2005 18:17:03 -0700 (MST) (envelope-from mfuhr) Date: Mon, 7 Mar 2005 18:17:03 -0700 From: Michael Fuhr To: Henry Ortega Cc: pgsql-sql@postgresql.org Subject: Re: drop view even with dependencies? Message-ID: <20050308011703.GA52095@winnie.fuhr.org> References: <2bffcc3305030713384c81d59b@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2bffcc3305030713384c81d59b@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/114 X-Sequence-Number: 20593 On Mon, Mar 07, 2005 at 04:38:53PM -0500, Henry Ortega wrote: > Is there a way to drop a VIEW in postgres without > the need to drop all the dependencies? .... > Also with tables, can I drop a table even if there are multiple views > that depend on it? I'm not aware of a way. It could be argued that doing so would be A Bad Thing: a view has a particular meaning, and by dropping the things the view depends on you'd be subverting that meaning. The DBMS doesn't know what your intentions are, so it doesn't allow you to break the dependencies. > It's such a pain in the neck to have to drop all the dependencies and > recreate them all over again. Do you not keep the definitions in a file? It can be useful to put all the necessary DROP and CREATE statements in a file, so if you need to change anything you simply edit the file and run "psql -f filename.sql". -- Michael Fuhr http://www.fuhr.org/~mfuhr/