Search Postgresql Archives

Isolation of schema renames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm wondering if I can/should expect schema renames to be isolated.

For example, I have two schemas "test" and "test_new". Each with a "test" table (with same columns, but different data).

In one transaction I'm renaming the schemas test => test_old, test_new => test. I.e.:

BEGIN;
ALTER SCHEMA test RENAME TO test_old;
ALTER SCHEMA test_new RENAME TO test;
COMMIT;

In another transaction I do:

BEGIN;
SELECT * FROM test.test;
<first transaction occurs here on a different session>
SELECT * FROM test.test;
COMMIT;

My expectation is that both "SELECT" would return the same data (or that the transaction performing the rename is blocked until the select transaction is complete).

In testing this on 9.5.7 the behaviour I see is that the select "SELECT" returns different data. (Regardless of isolation level chosen).

Is it possible to perform this rename in any way?

If not (which I suspect is the case) is this documented somewhere, I couldn't find it (but that is probably me not looking hard enough / in the right place).

Thanks,

Ben

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux