Re: Rename or Re-Create Constraints?
| От | Tom Lane |
|---|---|
| Тема | Re: Rename or Re-Create Constraints? |
| Дата | |
| Msg-id | 22101.1302309359@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Rename or Re-Create Constraints? (Carlos Mennens <carlos.mennens@gmail.com>) |
| Ответы |
Re: Rename or Re-Create Constraints?
Re: Rename or Re-Create Constraints? |
| Список | pgsql-general |
Carlos Mennens <carlos.mennens@gmail.com> writes:
> 1. Do I need to remove all the table constraints or is there a way to
> rename them?
I believe you can rename the underlying indexes and the constraints will
follow them. (This works in HEAD anyway, not sure how far back.)
> 2. When renaming the table, is there a way to rename both the table
> and all associated constraints?
No, there's nothing automatic for that. IIRC there used to be code to
try to do this when you renamed a single column; but we took it out,
probably because it risked unexpected failures due to index name
collisions.
regards, tom lane
В списке pgsql-general по дате отправления: