From: Michael Fuhr <mike@fuhr.org>
To: Henry Ortega <juandelacruz@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: drop view even with dependencies?
Date: Mon, 7 Mar 2005 18:17:03 -0700
Message-ID: <20050308011703.GA52095@winnie.fuhr.org> (raw)
In-Reply-To: <2bffcc3305030713384c81d59b@mail.gmail.com>
References: <2bffcc3305030713384c81d59b@mail.gmail.com>
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/
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: pgsql-sql@postgresql.org
Cc: mike@fuhr.org, juandelacruz@gmail.com
Subject: Re: drop view even with dependencies?
In-Reply-To: <20050308011703.GA52095@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox