Re: ALTER TABLE name RENAME TO new_name; does not work immediately

From: megous(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: ALTER TABLE name RENAME TO new_name; does not work immediately
Date: 2008-08-09 19:07:45
Message-ID: 5361d912-83ff-4c19-a2f7-e1ca383bede8@z66g2000hsc.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 9 Srp, 19:38, st(dot)(dot)(dot)(at)enterprisedb(dot)com (Gregory Stark) wrote:
> <meg(dot)(dot)(dot)(at)gmail(dot)com> writes:
> > ALTER TABLE name RENAME TO new_name;
> > ALTER TABLE new_name
> >   RENAME COLUMN x TO y;
>
> ...
> > I think the issue might be reproducible by creating table with a lot
> > of rows, setting high work_mem and issuing the commands, but I did not
> > try to reproduce it this way.
>
> The commands you described should take the same length of time regardless of
> the size of table and the memory settings are not relevant. I suspect you're
> actually running some different commands?
>
> --
>   Gregory Stark
>   EnterpriseDB          http://www.enterprisedb.com
>   Ask me about EnterpriseDB's On-Demand Production Tuning
>
> --
> Sent via pgsql-bugs mailing list (pgsql-b(dot)(dot)(dot)(at)postgresql(dot)org)
> To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-bugs

-- This script will migrate shema from the version 1.1.18 to the
version 1.2.0
-- (i.e. Gardeners integration)

This is what I actually run:

SET search_path = public, isn, pg_catalog;

SET maintenance_work_mem = 256000;
SET work_mem = 256000;

VACUUM FULL ANALYZE;
REINDEX DATABASE shakes;

BEGIN;

ALTER TABLE btbooks
RENAME TO exbooks;

-- following command returns the error
ALTER TABLE exbooks
RENAME COLUMN bt_price TO list_price;

-- many more other commands ....

COMMIT;

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message megous 2008-08-09 19:26:01 Re: ALTER TABLE name RENAME TO new_name; does not work immediately
Previous Message Gregory Stark 2008-08-09 17:38:42 Re: ALTER TABLE name RENAME TO new_name; does not work immediately