pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ross J. Reedstrom <reedstrm@rice.edu>
To: Kostis Mentzelos <mentzelos@ematic.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Re: rename a table
Date: Fri, 29 Jun 2001 13:03:05 -0500
Message-ID: <20010629130305.D17874@rice.edu> (raw)
In-Reply-To: <3B3659CA.BAADC592@ematic.com>
References: <3B31AB47.2A46172B@ematic.com>
	<3B3659CA.BAADC592@ematic.com>

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




view thread (6+ messages)

Message-ID: <20010629130305.D17874@rice.edu>
Permalink:  ../20010629130305.D17874@rice.edu/
Also on:    postgresql.org/message-id/20010629130305.D17874@rice.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: reedstrm@rice.edu, mentzelos@ematic.com
  Subject: Re: rename a table
  In-Reply-To: <20010629130305.D17874@rice.edu>
  References: <3B31AB47.2A46172B@ematic.com> <3B3659CA.BAADC592@ematic.com> <20010629130305.D17874@rice.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox