ALTER TABLE name RENAME TO new_name; does not work immediately - Mailing list pgsql-bugs

From megous@gmail.com
Subject ALTER TABLE name RENAME TO new_name; does not work immediately
Date
Msg-id 3a6a83c5-832c-4c75-a522-16d5d2eda2d7@b1g2000hsg.googlegroups.com
Whole thread Raw
Responses Re: ALTER TABLE name RENAME TO new_name; does not work immediately
List 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.

pgsql-bugs by date:

Previous
From: "Hiroshi Saito"
Date:
Subject: Re: BUG #4167: When generating UUID using UUID-OSSP module, UUIDs are not unique on Windows
Next
From: megous@gmail.com
Date:
Subject: Re: ALTER TABLE name RENAME TO new_name; does not work immediately