Re: Re: rename a table
От | Ross J. Reedstrom |
---|---|
Тема | Re: Re: rename a table |
Дата | |
Msg-id | 20010629130305.D17874@rice.edu обсуждение исходный текст |
Ответ на | Re: rename a table (Kostis Mentzelos <mentzelos@ematic.com>) |
Список | pgsql-admin |
On Mon, Jun 25, 2001 at 12:21:14AM +0300, Kostis Mentzelos wrote: > In order to rename the table safely, I want to REVOKE INSERT on that > table. > > But there is a problem because if there are users connected to > database then REVOKE command wait until they disconnect. > How can I found out who are connected to database? Can I kill them? > > -- > > I found out that SERIAL type creating a unique index. (RTFM) > I also found out that using ALTER TABLE x RENAME TO y I can rename > primary > keys and indexes. Be careful combining these two: the serial type creates a sequence as well as a unique index, the name of which is hardcoded into the DEFAULT clause for the table. Rename the table, and you'll need to leave the sequence alone, since the DEFAULT clause can't be dynamically changed (yet). Ross
В списке pgsql-admin по дате отправления: