Created
October 11, 2013 06:54
-
-
Save choplin/6930600 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- 準備 | |
| psql1 $ create table foo(v text); | |
| psql1 $ create table bar(v text); | |
| psql1 $ insert into foo values ('foo'); | |
| psql1 $ insert into tmp values ('bar'); | |
| -- swap: bar -> foo, foo -> bar | |
| psql1 $ begin; | |
| psql2 $ begin; | |
| psql1 $ alter table foo rename to tmp; | |
| psql2 $ select * from foo; | |
| psql1 $ alter table bar rename to foo; | |
| psql1 $ alter table tmp rename to bar; | |
| psql1 $ commit; | |
| -- 9.1 | |
| v | |
| ----- | |
| foo | |
| (1 row) | |
| -- 9.2 | |
| v | |
| ----- | |
| bar | |
| (1 row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment