Re: Alter view with dependence without drop view! - Mailing list pgsql-general

From btober@computer.org
Subject Re: Alter view with dependence without drop view!
Date
Msg-id 304712374.47914912.1517326452605.JavaMail.zimbra@broadstripe.net
Whole thread Raw
In response to Alter view with dependence without drop view!  (Elson Vaz <elsonlei@gmail.com>)
Responses Re: Alter view with dependence without drop view!  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
One way I have approached this problem is:

1) Use PgAdmin attempt the change.

2) Examine the error report PgAdmin displays that identifies which dependent views are preventing your progress.

3) Wrap your original DDL from step 1 within the DROP and CREATE DDL associated with the closest dependent view.

4) Return to step 1 and repeat until step 1 succeeds.

With multiple iterations of this procedure, you will incrementally grow a DDL script that drops dependent views in the correct order, eliminating dependencies, and then recreate them in the proper order, respecting dependencies.



When this procedure got old, I started using a script created using pg_dump and pg_restore, as initially outlined here:


and with a correction noted here:





-- B



From: "Elson Vaz" <elsonlei@gmail.com>
To: pgsql-general@lists.postgresql.org
Sent: Tuesday, January 30, 2018 8:40:45 AM
Subject: Alter view with dependence without drop view!

Hello!

I want make change in one view that have dependence view's, so when i try to make change i'm block because of this, what is the best solution??

thank you!!

best regard 

Elson Vaz

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Information on savepoint requirement within transctions
Next
From: HIRTZ Jorge Alberto TENARIS
Date:
Subject: PostgreSQL Kerberos Authentication