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: ALTER TABLE name RENAME TO new_name; does not work immediately
Date: 2008-08-09 00:47:34
Message-ID: 3a6a83c5-832c-4c75-a522-16d5d2eda2d7@b1g2000hsg.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello,

I don't know if this is expected behaviour or not, but I've found that
this sequence of commands does not work all the time:

ALTER TABLE name RENAME TO new_name;
ALTER TABLE new_name
RENAME COLUMN x TO y;

It usually works with small work_mem and maintenance_work_mem values.
If I increase work_mem and maintenance_work_mem to 256MB it stops
working and prints following error message:

ERROR: relation "new_name" does not exist

It doesn't matter whether the commands are run within the transaction
or not.

I'm running postgresql 8.3.3 on Core 2 Duo with 2GB ram. Actual table
has 700 000 rows. I think the issue might be timing related as I've
managed to "solve" the issue by putting SAVEPOINT between the commands
on one machine. But on other machine this did not help.

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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message megous 2008-08-09 00:55:42 Re: ALTER TABLE name RENAME TO new_name; does not work immediately
Previous Message Hiroshi Saito 2008-08-08 16:48:46 Re: BUG #4167: When generating UUID using UUID-OSSP module, UUIDs are not unique on Windows