forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb834713
committed
Fix DROP TABLESPACE to unlink symlink when directory is not there.
If the tablespace directory is missing entirely, we allow DROP TABLESPACEto go through, on the grounds that it should be possible to clean up thecatalog entry in such a situation. However, we forgot that the pg_tblspcsymlink might still be there. We should try to remove the symlink too(but not fail if it's no longer there), since not doing so can lead toweird behavior subsequently, as per report from Michael Nolan.There was some discussion of adding dependency links to prevent DROPTABLESPACE when the catalogs still contain references to the tablespace.That might be worth doing too, but it's an orthogonal question, and inany case wouldn't be back-patchable.Back-patch to 9.0, which is as far back as the logic looks like this.We could possibly do something similar in 8.x, but given the lack ofreports I'm not sure it's worth the trouble, and anyway the case couldnot arise in the form the logic is meant to cover (namely, a post-DROPtransaction rollback having resurrected the pg_tablespace entry aftersome or all of the filesystem infrastructure is gone).1 parent966970e commitb834713
1 file changed
+9
-6
lines changedLines changed: 9 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
678 | 678 |
| |
679 | 679 |
| |
680 | 680 |
| |
681 |
| - | |
682 |
| - | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
683 | 684 |
| |
684 | 685 |
| |
685 | 686 |
| |
| |||
691 | 692 |
| |
692 | 693 |
| |
693 | 694 |
| |
694 |
| - | |
695 |
| - | |
| 695 | + | |
| 696 | + | |
696 | 697 |
| |
697 | 698 |
| |
698 | 699 |
| |
| |||
755 | 756 |
| |
756 | 757 |
| |
757 | 758 |
| |
758 |
| - | |
| 759 | + | |
| 760 | + | |
759 | 761 |
| |
| 762 | + | |
760 | 763 |
| |
761 | 764 |
| |
762 | 765 |
| |
| |||
770 | 773 |
| |
771 | 774 |
| |
772 | 775 |
| |
773 |
| - | |
| 776 | + | |
774 | 777 |
| |
775 | 778 |
| |
776 | 779 |
| |
|
0 commit comments
Comments
(0)