Re: Support for idempotent schema changes?

Поиск
Список
Период
Сортировка
От David Lowe
Тема Re: Support for idempotent schema changes?
Дата
Msg-id A59E91A937445645A59CEFAAA15D642646DB05@exch.apnwi.com
обсуждение исходный текст
Ответ на Re: Support for idempotent schema changes?  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Support for idempotent schema changes?  ("Joshua D. Drake" <jd@commandprompt.com>)
Список pgsql-general
Within the context of a script, executing:

Begin
Statement1
Statement2
Statement3
Commit

Where I only wish to commit if the error is specific to the object
already existing, and rollback for all other errors, what's the best way
to accomplish that?


-----Original Message-----
From: Peter Eisentraut [mailto:peter_e@gmx.net]
Sent: Saturday, March 03, 2007 11:45 PM
To: pgsql-general@postgresql.org
Cc: David Lowe
Subject: Re: [GENERAL] Support for idempotent schema changes?

David Lowe wrote:
> So how can I make statements of the form:

> *      alter table only customers add constraint
> a_previously_missed_constraint unique (a, b, c);
>
> *      add column points int4 not null default 0;

> idempotent?

You just ignore the error if the object already exists.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

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

Предыдущее
От: "Timasmith"
Дата:
Сообщение: Re: Can I getting a unique ID from a select
Следующее
От: "Eddy D. Sanchez"
Дата:
Сообщение: pljava on mac