Re: alter table alter type CASCADE

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Sim Zacks <sim(at)compulab(dot)co(dot)il>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: alter table alter type CASCADE
Date: 2010-05-05 12:51:18
Message-ID: s2xdcc563d11005050551r6808ea05x29be828a769f93f5@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2010/5/5 Sim Zacks <sim(at)compulab(dot)co(dot)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;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2010-05-05 12:52:45 Re: temp sequence
Previous Message Scott Marlowe 2010-05-05 12:47:59 Re: Savepoint and prepared transactions