forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitdfb75e4
committed
Add primary keys and unique constraints to system catalogs
For those system catalogs that have a unique indexes, make a primarykey and unique constraint, using ALTER TABLE ... PRIMARY KEY/UNIQUEUSING INDEX.This can be helpful for GUI tools that look for a primary key, and itmight in the future allow declaring foreign keys, for making schemadiagrams.The constraint creation statements are automatically created bygenbki.pl from DECLARE_UNIQUE_INDEX directives. To specify which oneof the available unique indexes is the primary key, use the newdirective DECLARE_UNIQUE_INDEX_PKEY instead. By convention, weusually make a catalog's OID column its primary key, if it has one.Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://www.postgresql.org/message-id/flat/dc5f44d9-5ec1-a596-0251-dadadcdede98@2ndquadrant.com1 parent6533062 commitdfb75e4
File tree
71 files changed
+177
-126
lines changed- src
- backend/catalog
- bin/initdb
- include/catalog
- test
- modules/unsafe_tests
- expected
- sql
- regress
- expected
- sql
- tools/msvc
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
71 files changed
+177
-126
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
| 3 | + | |
3 | 4 |
| |
4 | 5 |
|
Lines changed: 6 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
94 | 94 |
| |
95 | 95 |
| |
96 | 96 |
| |
97 |
| - | |
| 97 | + | |
98 | 98 |
| |
99 | 99 |
| |
100 |
| - | |
| 100 | + | |
101 | 101 |
| |
102 |
| - | |
103 |
| - | |
104 |
| - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
105 | 106 |
| |
106 | 107 |
| |
107 | 108 |
| |
|
Lines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
121 | 121 |
| |
122 | 122 |
| |
123 | 123 |
| |
| 124 | + | |
124 | 125 |
| |
125 | 126 |
| |
126 | 127 |
| |
| |||
130 | 131 |
| |
131 | 132 |
| |
132 | 133 |
| |
133 |
| - | |
| 134 | + | |
134 | 135 |
| |
135 |
| - | |
136 |
| - | |
| 136 | + | |
| 137 | + | |
137 | 138 |
| |
138 | 139 |
| |
139 | 140 |
| |
140 |
| - | |
| 141 | + |
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
55 | 55 |
| |
56 | 56 |
| |
57 | 57 |
| |
| 58 | + | |
58 | 59 |
| |
59 | 60 |
| |
60 | 61 |
| |
| |||
137 | 138 |
| |
138 | 139 |
| |
139 | 140 |
| |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
140 | 152 |
| |
141 | 153 |
| |
142 | 154 |
| |
| |||
388 | 400 |
| |
389 | 401 |
| |
390 | 402 |
| |
| 403 | + | |
| 404 | + | |
| 405 | + | |
391 | 406 |
| |
392 | 407 |
| |
393 | 408 |
| |
| |||
648 | 663 |
| |
649 | 664 |
| |
650 | 665 |
| |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
651 | 672 |
| |
652 | 673 |
| |
653 | 674 |
| |
| |||
688 | 709 |
| |
689 | 710 |
| |
690 | 711 |
| |
| 712 | + | |
691 | 713 |
| |
692 | 714 |
| |
693 | 715 |
| |
694 | 716 |
| |
| 717 | + | |
695 | 718 |
| |
696 | 719 |
| |
697 | 720 |
| |
|
Lines changed: 14 additions & 46 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
159 | 159 |
| |
160 | 160 |
| |
161 | 161 |
| |
| 162 | + | |
162 | 163 |
| |
163 | 164 |
| |
164 | 165 |
| |
| |||
251 | 252 |
| |
252 | 253 |
| |
253 | 254 |
| |
254 |
| - | |
| 255 | + | |
255 | 256 |
| |
256 | 257 |
| |
257 |
| - | |
258 | 258 |
| |
259 | 259 |
| |
260 | 260 |
| |
| |||
1600 | 1600 |
| |
1601 | 1601 |
| |
1602 | 1602 |
| |
1603 |
| - | |
| 1603 | + | |
1604 | 1604 |
| |
1605 | 1605 |
| |
1606 |
| - | |
| 1606 | + | |
1607 | 1607 |
| |
1608 |
| - | |
1609 |
| - | |
| 1608 | + | |
1610 | 1609 |
| |
1611 |
| - | |
| 1610 | + | |
1612 | 1611 |
| |
1613 |
| - | |
| 1612 | + | |
1614 | 1613 |
| |
1615 | 1614 |
| |
1616 | 1615 |
| |
1617 | 1616 |
| |
1618 | 1617 |
| |
1619 | 1618 |
| |
1620 | 1619 |
| |
1621 |
| - | |
| 1620 | + | |
1622 | 1621 |
| |
1623 | 1622 |
| |
1624 | 1623 |
| |
| |||
1661 | 1660 |
| |
1662 | 1661 |
| |
1663 | 1662 |
| |
1664 |
| - | |
1665 |
| - | |
1666 |
| - | |
1667 |
| - | |
1668 |
| - | |
1669 |
| - | |
1670 |
| - | |
1671 |
| - | |
1672 |
| - | |
1673 |
| - | |
1674 |
| - | |
1675 |
| - | |
1676 |
| - | |
1677 |
| - | |
1678 |
| - | |
1679 |
| - | |
1680 |
| - | |
1681 |
| - | |
1682 |
| - | |
1683 |
| - | |
1684 |
| - | |
1685 | 1663 |
| |
1686 | 1664 |
| |
1687 | 1665 |
| |
| |||
1882 | 1860 |
| |
1883 | 1861 |
| |
1884 | 1862 |
| |
1885 |
| - | |
1886 |
| - | |
1887 |
| - | |
1888 |
| - | |
1889 |
| - | |
1890 |
| - | |
1891 |
| - | |
1892 |
| - | |
1893 |
| - | |
1894 |
| - | |
1895 |
| - | |
1896 |
| - | |
1897 |
| - | |
1898 |
| - | |
| 1863 | + | |
1899 | 1864 |
| |
1900 | 1865 |
| |
1901 | 1866 |
| |
| |||
2534 | 2499 |
| |
2535 | 2500 |
| |
2536 | 2501 |
| |
| 2502 | + | |
2537 | 2503 |
| |
2538 | 2504 |
| |
2539 | 2505 |
| |
| |||
2895 | 2861 |
| |
2896 | 2862 |
| |
2897 | 2863 |
| |
| 2864 | + | |
| 2865 | + | |
2898 | 2866 |
| |
2899 | 2867 |
| |
2900 | 2868 |
| |
2901 | 2869 |
| |
2902 | 2870 |
| |
2903 | 2871 |
| |
2904 | 2872 |
| |
2905 |
| - | |
| 2873 | + | |
2906 | 2874 |
| |
2907 | 2875 |
| |
2908 | 2876 |
| |
2909 | 2877 |
| |
2910 | 2878 |
| |
2911 |
| - | |
| 2879 | + | |
2912 | 2880 |
| |
2913 | 2881 |
| |
2914 | 2882 |
| |
|
Lines changed: 8 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
55 | 55 |
| |
56 | 56 |
| |
57 | 57 |
| |
58 |
| - | |
| 58 | + | |
59 | 59 |
| |
60 | 60 |
| |
61 |
| - | |
62 |
| - | |
63 |
| - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
64 | 67 |
| |
65 | 68 |
| |
66 | 69 |
| |
| |||
70 | 73 |
| |
71 | 74 |
| |
72 | 75 |
| |
| 76 | + | |
73 | 77 |
| |
74 | 78 |
| |
75 | 79 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
110 | 110 |
| |
111 | 111 |
| |
112 | 112 |
| |
113 |
| - | |
| 113 | + | |
114 | 114 |
| |
115 | 115 |
| |
116 | 116 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
52 |
| - | |
| 52 | + | |
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
94 |
| - | |
| 94 | + | |
95 | 95 |
| |
96 | 96 |
| |
97 | 97 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
69 | 69 |
| |
70 | 70 |
| |
71 | 71 |
| |
72 |
| - | |
| 72 | + | |
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
50 | 50 |
| |
51 | 51 |
| |
52 | 52 |
| |
53 |
| - | |
| 53 | + | |
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
194 | 194 |
| |
195 | 195 |
| |
196 | 196 |
| |
197 |
| - | |
| 197 | + | |
198 | 198 |
| |
199 | 199 |
| |
200 | 200 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
45 |
| - | |
| 45 | + | |
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
64 |
| - | |
| 64 | + | |
65 | 65 |
| |
66 | 66 |
| |
67 | 67 |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
56 | 56 |
| |
57 | 57 |
| |
58 | 58 |
| |
59 |
| - | |
| 59 | + | |
60 | 60 |
| |
61 | 61 |
| |
62 | 62 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
152 | 152 |
| |
153 | 153 |
| |
154 | 154 |
| |
155 |
| - | |
| 155 | + | |
156 | 156 |
| |
157 | 157 |
| |
158 | 158 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
48 | 48 |
| |
49 | 49 |
| |
50 | 50 |
| |
51 |
| - | |
| 51 | + | |
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
161 | 161 |
| |
162 | 162 |
| |
163 | 163 |
| |
164 |
| - | |
| 164 | + | |
165 | 165 |
| |
166 | 166 |
| |
167 | 167 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
67 |
| - | |
| 67 | + | |
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
|
0 commit comments
Comments
(0)