Re: Table modifications with dependent views - best practices?

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Table modifications with dependent views - best practices?
Дата
Msg-id 20050422032624.GA45074@winnie.fuhr.org
обсуждение исходный текст
Ответ на Table modifications with dependent views - best practices?  (John Browne <jkbrowne@gmail.com>)
Ответы Re: Table modifications with dependent views - best
Список pgsql-general
On Thu, Apr 21, 2005 at 09:24:49PM -0500, John Browne wrote:
>
> Ok, I've been using postgres for a-while now, and am curious how you
> guys handle this.  What is the best way to make modifications to
> tables that have lots of dependent objects, like views?  Do you just
> do the obvious drop...cascade and manually re-create your views? Do
> you keep your "create view" statements in a text file for this purpose
> or just pull them from a pg_dump file?  Is there a better way to
> handle this sort of thing?

I put CREATE statements in a file so I can easily reload them.
Sometimes I put views and functions in their own files so they can
be reloaded separately, since dropping and recreating them is usually
a trivial, non-destructive operation, unlike dropping and recreating
tables.

I usually put DDL statements in a transaction, for a couple of
reasons: so that a mistake doesn't leave me with half-done work
(any error will cause the entire transaction to roll back), and to
make the changes atomic for the benefit of other transactions.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: timezone() with timeofday() converts the wrong direction?
Следующее
От: Typing80wpm@aol.com
Дата:
Сообщение: listing all tables