Re: alter table alter type CASCADE - Mailing list pgsql-general

From Scott Marlowe
Subject Re: alter table alter type CASCADE
Date
Msg-id s2xdcc563d11005050551r6808ea05x29be828a769f93f5@mail.gmail.com
Whole thread Raw
In response to alter table alter type CASCADE  (Sim Zacks <sim@compulab.co.il>)
List pgsql-general
2010/5/5 Sim Zacks <sim@compulab.co.il>:
> One of the biggest problems I have maintaining a database with a lot of
> views is that when I want to change a datatype, I have to drop every
> view uses the column and every view that uses those views etc...
> This turns into a maintenance nightmare.

Then I would question your approach to maintenance.  In the past when
I've had to deal with this type of thing, all views were created from
a script.  Edit the script, run the script, you're done.  Do it in a
transaction and if there are any errors nothing changes.  Script looks
something like:

begin;
drop view x1;
drop view y1;
... more drop statements
create view x1...
create view y1 ...
commit;

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Savepoint and prepared transactions
Next
From: Scott Marlowe
Date:
Subject: Re: temp sequence