Commit fad3b5b
committed
Fix failure of ALTER FOREIGN TABLE SET SCHEMA to move sequences.
Ordinary ALTER TABLE SET SCHEMA will also move any owned sequences
into the new schema. We failed to do likewise for foreign tables,
because AlterTableNamespaceInternal believed that only certain
relkinds could have indexes, owned sequences, or constraints.
We could simply add foreign tables to that relkind list, but it
seems likely that the same oversight could be made again in
future. Instead let's remove the relkind filter altogether.
These functions shouldn't cost much when there are no objects
that they need to process, and surely this isn't an especially
performance-critical case anyway.
Per bug #18407 from Vidushi Gupta. Back-patch to all supported
branches.
Discussion: https://postgr.es/m/18407-4fd07373d252c6a0@postgresql.org1 parent 7644a73 commit fad3b5b
File tree
3 files changed
+24
-22
lines changed- src
- backend/commands
- test/regress
- expected
- sql
3 files changed
+24
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17860 | 17860 | | |
17861 | 17861 | | |
17862 | 17862 | | |
17863 | | - | |
17864 | | - | |
17865 | | - | |
17866 | | - | |
17867 | | - | |
17868 | | - | |
17869 | | - | |
17870 | | - | |
17871 | | - | |
17872 | | - | |
| 17863 | + | |
| 17864 | + | |
| 17865 | + | |
| 17866 | + | |
| 17867 | + | |
17873 | 17868 | | |
17874 | 17869 | | |
17875 | 17870 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
897 | 897 | | |
898 | 898 | | |
899 | 899 | | |
| 900 | + | |
900 | 901 | | |
901 | 902 | | |
902 | 903 | | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
903 | 907 | | |
904 | 908 | | |
905 | 909 | | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
917 | | - | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
918 | 923 | | |
919 | 924 | | |
920 | 925 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| 422 | + | |
422 | 423 | | |
423 | 424 | | |
| 425 | + | |
424 | 426 | | |
425 | 427 | | |
426 | 428 | | |
| |||
0 commit comments