From: | "Ross J(dot) Reedstrom" <reedstrm(at)rice(dot)edu> |
---|---|
To: | Kostis Mentzelos <mentzelos(at)ematic(dot)com> |
Cc: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: Re: rename a table |
Date: | 2001-06-29 18:03:05 |
Message-ID: | 20010629130305.D17874@rice.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Anuradha Ratnaweera | 2001-07-01 04:24:47 | Re: Intentionally splitting data in a table across files. |
Previous Message | Bruce Momjian | 2001-06-29 17:21:58 | Re: [PATCHES] Re: High Memory Usage Patch -- Disregard my last message |