Re: Re: rename a table - Mailing list pgsql-admin

From Ross J. Reedstrom
Subject Re: Re: rename a table
Date
Msg-id 20010629130305.D17874@rice.edu
Whole thread Raw
In response to Re: rename a table  (Kostis Mentzelos <mentzelos@ematic.com>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Postgresql 7.1 dying on Debian Woody
Next
From: Anuradha Ratnaweera
Date:
Subject: Re: Intentionally splitting data in a table across files.