pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Perrin <aperrin@socrates.berkeley.edu>
Cc: pgsql-sql@postgresql.org
Subject: Re: all views in database broken at once
Date: Sat, 24 Mar 2001 19:50:00 -0500
Message-ID: <10008.985481400@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.21.0103241930230.26693-100000@nujoma.perrins>
References: <Pine.LNX.4.21.0103241930230.26693-100000@nujoma.perrins>

Andrew Perrin <aperrin@socrates.berkeley.edu> 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



view thread (9+ messages)  latest in thread

Message-ID: <10008.985481400@sss.pgh.pa.us>
Permalink:  ../10008.985481400@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10008.985481400@sss.pgh.pa.us

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, aperrin@socrates.berkeley.edu
  Subject: Re: all views in database broken at once
  In-Reply-To: <10008.985481400@sss.pgh.pa.us>
  References: <Pine.LNX.4.21.0103241930230.26693-100000@nujoma.perrins> <10008.985481400@sss.pgh.pa.us>

* 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