Re: Dynamic constraint names in ALTER TABLE

Поиск
Список
Период
Сортировка
От patrick keshishian
Тема Re: Dynamic constraint names in ALTER TABLE
Дата
Msg-id CAN0yQBqOf5C+Mz2oZYpgJrLW9UU5Bhq4tR8-LSWdPnP_TtfvuA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Dynamic constraint names in ALTER TABLE  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Mon, Sep 19, 2011 at 8:34 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> patrick keshishian <pkeshish@gmail.com> writes:
>> The question wasn't where does one find the name of the constraint. My
>> example demonstrated that I knew how to get that value. The question,
>> however, is how do you get that in an ALTER TABLE statement?
>
> You'd need to construct the ALTER statement as a string value and then
> EXECUTE it, using a plpgsql function.  (In 9.0 you could use a DO
> command, but if you want this to also work in 7.4, it'll have to be a
> plain old function.)

OK. Thanks all.

--patrick

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

Предыдущее
От: patrick keshishian
Дата:
Сообщение: Re: Dynamic constraint names in ALTER TABLE
Следующее
От: AI Rumman
Дата:
Сообщение: Is there any way to import a portion of a large database