- Notifications
You must be signed in to change notification settings - Fork5
Commit7bddca3
committed
Fix up foreign-key mechanism so that there is a sound semantic basis for the
equality checks it applies, instead of a random dependence on whateveroperators might be named "=". The equality operators will now be selectedfrom the opfamily of the unique index that the FK constraint depends on toenforce uniqueness of the referenced columns; therefore they are certain to beconsistent with that index's notion of equality. Among other things thisshould fix the problem noted awhile back that pg_dump may fail for foreign-keyconstraints on user-defined types when the required operators aren't in thesearch path. This also means that the former warning condition about "foreignkey constraint will require costly sequential scans" is gone: if thecomparison condition isn't indexable then we'll reject the constraintentirely. All per past discussions.Along the way, make the RI triggers look into pg_constraint for theirinformation, instead of using pg_trigger.tgargs; and get rid of the alwayserror-prone fixed-size string buffers in ri_triggers.c in favor of building upthe RI queries in StringInfo buffers.initdb forced due to columns added to pg_constraint and pg_trigger.1 parent65e2f55 commit7bddca3
File tree
33 files changed
+1709
-1643
lines changed- doc/src/sgml
- src
- backend
- catalog
- commands
- tcop
- utils
- adt
- cache
- bin
- pg_dump
- psql
- include
- catalog
- commands
- utils
- test/regress
- expected
- sql
33 files changed
+1709
-1643
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
1870 | 1870 | | |
1871 | 1871 | | |
1872 | 1872 | | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
1873 | 1894 | | |
1874 | 1895 | | |
1875 | 1896 | | |
| |||
1899 | 1920 | | |
1900 | 1921 | | |
1901 | 1922 | | |
1902 | | - | |
1903 | | - | |
| 1923 | + | |
| 1924 | + | |
1904 | 1925 | | |
1905 | 1926 | | |
1906 | 1927 | | |
| |||
4166 | 4187 | | |
4167 | 4188 | | |
4168 | 4189 | | |
4169 | | - | |
| 4190 | + | |
4170 | 4191 | | |
4171 | 4192 | | |
4172 | 4193 | | |
4173 | 4194 | | |
4174 | 4195 | | |
4175 | 4196 | | |
4176 | | - | |
| 4197 | + | |
4177 | 4198 | | |
4178 | 4199 | | |
4179 | 4200 | | |
4180 | 4201 | | |
4181 | 4202 | | |
4182 | 4203 | | |
4183 | | - | |
| 4204 | + | |
| 4205 | + | |
| 4206 | + | |
| 4207 | + | |
| 4208 | + | |
| 4209 | + | |
| 4210 | + | |
| 4211 | + | |
4184 | 4212 | | |
4185 | 4213 | | |
4186 | 4214 | | |
4187 | 4215 | | |
4188 | 4216 | | |
4189 | 4217 | | |
4190 | | - | |
| 4218 | + | |
4191 | 4219 | | |
4192 | 4220 | | |
4193 | 4221 | | |
4194 | 4222 | | |
4195 | 4223 | | |
4196 | 4224 | | |
4197 | | - | |
| 4225 | + | |
4198 | 4226 | | |
4199 | 4227 | | |
4200 | 4228 | | |
| |||
4221 | 4249 | | |
4222 | 4250 | | |
4223 | 4251 | | |
| 4252 | + | |
| 4253 | + | |
| 4254 | + | |
| 4255 | + | |
| 4256 | + | |
| 4257 | + | |
| 4258 | + | |
| 4259 | + | |
| 4260 | + | |
| 4261 | + | |
| 4262 | + | |
| 4263 | + | |
4224 | 4264 | | |
4225 | 4265 | | |
4226 | 4266 | | |
4227 | | - | |
| 4267 | + | |
4228 | 4268 | | |
4229 | 4269 | | |
4230 | 4270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
| 470 | + | |
470 | 471 | | |
471 | 472 | | |
472 | 473 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
2314 | 2314 | | |
2315 | 2315 | | |
2316 | 2316 | | |
2317 | | - | |
| 2317 | + | |
2318 | 2318 | | |
2319 | 2319 | | |
2320 | 2320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
1758 | 1758 | | |
1759 | 1759 | | |
1760 | 1760 | | |
1761 | | - | |
1762 | | - | |
1763 | | - | |
1764 | | - | |
| 1761 | + | |
1765 | 1762 | | |
1766 | 1763 | | |
1767 | | - | |
1768 | | - | |
1769 | | - | |
1770 | | - | |
1771 | | - | |
1772 | | - | |
1773 | | - | |
1774 | | - | |
1775 | | - | |
1776 | | - | |
1777 | | - | |
1778 | | - | |
1779 | | - | |
1780 | | - | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
1781 | 1769 | | |
1782 | | - | |
1783 | | - | |
| 1770 | + | |
1784 | 1771 | | |
1785 | 1772 | | |
1786 | 1773 | | |
| |||
1794 | 1781 | | |
1795 | 1782 | | |
1796 | 1783 | | |
1797 | | - | |
1798 | | - | |
| 1784 | + | |
1799 | 1785 | | |
1800 | 1786 | | |
1801 | 1787 | | |
1802 | 1788 | | |
1803 | 1789 | | |
1804 | 1790 | | |
1805 | 1791 | | |
1806 | | - | |
| 1792 | + | |
1807 | 1793 | | |
1808 | 1794 | | |
1809 | 1795 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
1463 | 1463 | | |
1464 | 1464 | | |
1465 | 1465 | | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
1466 | 1469 | | |
1467 | 1470 | | |
1468 | 1471 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
680 | 680 | | |
681 | 681 | | |
682 | 682 | | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
683 | 686 | | |
684 | 687 | | |
685 | 688 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
1199 | 1199 | | |
1200 | 1200 | | |
1201 | 1201 | | |
1202 | | - | |
| 1202 | + | |
1203 | 1203 | | |
1204 | 1204 | | |
1205 | 1205 | | |
| |||
0 commit comments
Comments
(0)