Re: Is there a way to 'unrestrict' drop view?

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Thomas Pasch *EXTERN*" <thomas(dot)pasch(at)nuclos(dot)de>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is there a way to 'unrestrict' drop view?
Date: 2011-07-22 14:19:16
Message-ID: D960CB61B694CF459DCFB4B0128514C206B20F50@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas Pasch wrote:
> well, the reason I'm asking is that this *is* posible in Oracle DB.
For
> me it looks like that the DB knows that the view is broken. You can't
> use it, *but* it is still there (and it will be usable again when the
> view query is valid again).

True, but Oracle pays a price for it. There is never a guarantee that
all objects in the database are consistent, and in fact you're always
likely to have a number of 'invalid' objects around that might fail or
not if you use them.

> The heart of the my pain is that a program I use works like this. I
> would like to migrate the DB beneath it...

I'd say that a program that changes views on the fly has a questionable
design, but obviously that won't help you.

You could automatically find out all dependent views (via pg_depend),
get their DDL (with pg_get_viewdef()) and drop and recreate them in
order.
That's painful of course.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ilia Lilov 2011-07-22 15:45:30 Locking several tables within one transaction
Previous Message Tom Lane 2011-07-22 13:56:54 Re: Is there a way to 'unrestrict' drop view?