forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit578b229
committed
Remove WITH OIDS support, change oid catalog column visibility.
Previously tables declared WITH OIDS, including a significant fractionof the catalog tables, stored the oid column not as a normal column,but as part of the tuple header.This special column was not shown by default, which was somewhat odd,as it's often (consider e.g. pg_class.oid) one of the more importantparts of a row. Neither pg_dump nor COPY included the contents of theoid column by default.The fact that the oid column was not an ordinary column necessitated asignificant amount of special case code to support oid columns. Thatalready was painful for the existing, but upcoming work aiming to maketable storage pluggable, would have required expanding and duplicatingthat "specialness" significantly.WITH OIDS has been deprecated since 2005 (commit ff02d0a05280e0).Remove it.Removing includes:- CREATE TABLE and ALTER TABLE syntax for declaring the table to be WITH OIDS has been removed (WITH (oids[ = true]) will error out)- pg_dump does not support dumping tables declared WITH OIDS and will issue a warning when dumping one (and ignore the oid column).- restoring an pg_dump archive with pg_restore will warn when restoring a table with oid contents (and ignore the oid column)- COPY will refuse to load binary dump that includes oids.- pg_upgrade will error out when encountering tables declared WITH OIDS, they have to be altered to remove the oid column first.- Functionality to access the oid of the last inserted row (like plpgsql's RESULT_OID, spi's SPI_lastoid, ...) has been removed.The syntax for declaring a table WITHOUT OIDS (or WITH (oids = false)for CREATE TABLE) is still supported. While that requires a bit ofsupport code, it seems unnecessary to break applications / dumps thatdo not use oids, and are explicit about not using them.The biggest user of WITH OID columns was postgres' catalog. Thiscommit changes all 'magic' oid columns to be columns that are normallydeclared and stored. To reduce unnecessary query breakage all thenewly added columns are still named 'oid', even if a table's columnnaming scheme would indicate 'reloid' or such. This obviouslyrequires adapting a lot code, mostly replacing oid access viaHeapTupleGetOid() with access to the underlying Form_pg_*->oid column.The bootstrap process now assigns oids for all oid columns ingenbki.pl that do not have an explicit value (starting at the largestoid previously used), only oids assigned later by oids will be aboveFirstBootstrapObjectId. As the oid column now is a normal column thespecial bootstrap syntax for oids has been removed.Oids are not automatically assigned during insertion anymore, allbackend code explicitly assigns oids with GetNewOidWithIndex(). Forthe rare case that insertions into the catalog via SQL are called forthe new pg_nextoid() function can be used (which only works on catalogtables).The fact that oid columns on system tables are now normal columnsmeans that they will be included in the set of columns expandedby * (i.e. SELECT * FROM pg_class will now include the table's oid,previously it did not). It'd not technically be hard to hide oidcolumn by default, but that'd mean confusing behavior would eitherhave to be carried forward forever, or it'd cause breakage down theline.While it's not unlikely that further adjustments are needed, thescope/invasiveness of the patch makes it worthwhile to get merge thisnow. It's painful to maintain externally, too complicated to commitafter the code code freeze, and a dependency of a number of otherpatches.Catversion bump, for obvious reasons.Author: Andres Freund, with contributions by John NaylorDiscussion:https://postgr.es/m/20180930034810.ywp2c7awz7opzcfr@alap3.anarazel.de1 parent0999ac4 commit578b229
File tree
343 files changed
+2292
-4291
lines changed- contrib
- adminpack
- btree_gist
- expected
- sql
- dblink
- file_fdw
- pageinspect
- pg_buffercache
- pg_visibility
- postgres_fdw
- expected
- sql
- sepgsql
- expected
- sql
- test_decoding
- unaccent
- doc/src/sgml
- ref
- src
- backend
- access
- brin
- common
- gin
- gist
- heap
- transam
- bootstrap
- catalog
- commands
- executor
- foreign
- optimizer/util
- parser
- postmaster
- replication
- libpqwalreceiver
- logical
- rewrite
- statistics
- storage/large_object
- tcop
- tsearch
- utils
- adt
- cache
- fmgr
- init
- misc
- mmgr
- bin
- initdb
- pg_dump
- t
- pg_upgrade
- pgbench/t
- psql
- include
- access
- bootstrap
- catalog
- commands
- executor
- nodes
- parser
- utils
- interfaces/ecpg/preproc
- pl
- plperl
- plpgsql/src
- tcl
- expected
- sql
- test
- modules
- test_ddl_deparse
- expected
- sql
- test_predtest
- regress
- expected
- sql
- tools/findoidjoins
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
343 files changed
+2292
-4291
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
502 | 502 |
| |
503 | 503 |
| |
504 | 504 |
| |
505 |
| - | |
| 505 | + | |
506 | 506 |
| |
507 | 507 |
| |
508 | 508 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
|
Lines changed: 21 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
4 | 6 |
| |
5 | 7 |
| |
6 |
| - | |
| 8 | + | |
7 | 9 |
| |
8 | 10 |
| |
9 |
| - | |
| 11 | + | |
10 | 12 |
| |
11 | 13 |
| |
12 |
| - | |
| 14 | + | |
13 | 15 |
| |
14 | 16 |
| |
15 |
| - | |
| 17 | + | |
16 | 18 |
| |
17 | 19 |
| |
18 | 20 |
| |
19 | 21 |
| |
20 | 22 |
| |
21 |
| - | |
| 23 | + | |
22 | 24 |
| |
23 | 25 |
| |
24 |
| - | |
| 26 | + | |
25 | 27 |
| |
26 | 28 |
| |
27 |
| - | |
| 29 | + | |
28 | 30 |
| |
29 | 31 |
| |
30 |
| - | |
| 32 | + | |
31 | 33 |
| |
32 | 34 |
| |
33 |
| - | |
| 35 | + | |
34 | 36 |
| |
35 |
| - | |
| 37 | + | |
36 | 38 |
| |
37 | 39 |
| |
38 |
| - | |
| 40 | + | |
39 | 41 |
| |
40 | 42 |
| |
41 |
| - | |
| 43 | + | |
42 | 44 |
| |
43 | 45 |
| |
44 |
| - | |
| 46 | + | |
45 | 47 |
| |
46 | 48 |
| |
47 |
| - | |
| 49 | + | |
48 | 50 |
| |
49 | 51 |
| |
50 | 52 |
| |
51 | 53 |
| |
52 | 54 |
| |
53 |
| - | |
| 55 | + | |
54 | 56 |
| |
55 | 57 |
| |
56 |
| - | |
| 58 | + | |
57 | 59 |
| |
58 | 60 |
| |
59 |
| - | |
| 61 | + | |
60 | 62 |
| |
61 | 63 |
| |
62 |
| - | |
| 64 | + | |
63 | 65 |
| |
64 | 66 |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
| 3 | + | |
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
|
Lines changed: 14 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
5 |
| - | |
| 5 | + | |
| 6 | + | |
6 | 7 |
| |
7 |
| - | |
| 8 | + | |
8 | 9 |
| |
9 |
| - | |
| 10 | + | |
10 | 11 |
| |
11 |
| - | |
| 12 | + | |
12 | 13 |
| |
13 |
| - | |
| 14 | + | |
14 | 15 |
| |
15 |
| - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 |
| |
17 | 20 |
| |
18 | 21 |
| |
19 |
| - | |
| 22 | + | |
20 | 23 |
| |
21 |
| - | |
| 24 | + | |
22 | 25 |
| |
23 |
| - | |
| 26 | + | |
24 | 27 |
| |
25 |
| - | |
| 28 | + | |
26 | 29 |
| |
27 |
| - | |
| 30 | + |
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
849 | 849 |
| |
850 | 850 |
| |
851 | 851 |
| |
852 |
| - | |
| 852 | + | |
853 | 853 |
| |
854 | 854 |
| |
855 | 855 |
| |
| |||
1032 | 1032 |
| |
1033 | 1033 |
| |
1034 | 1034 |
| |
1035 |
| - | |
| 1035 | + | |
1036 | 1036 |
| |
1037 | 1037 |
| |
1038 | 1038 |
| |
| |||
1526 | 1526 |
| |
1527 | 1527 |
| |
1528 | 1528 |
| |
1529 |
| - | |
| 1529 | + | |
1530 | 1530 |
| |
1531 | 1531 |
| |
1532 | 1532 |
| |
| |||
1904 | 1904 |
| |
1905 | 1905 |
| |
1906 | 1906 |
| |
1907 |
| - | |
| 1907 | + | |
1908 | 1908 |
| |
1909 | 1909 |
| |
1910 | 1910 |
| |
|
Lines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
727 | 727 |
| |
728 | 728 |
| |
729 | 729 |
| |
730 |
| - | |
731 |
| - | |
| 730 | + | |
732 | 731 |
| |
733 | 732 |
| |
734 | 733 |
| |
| |||
1148 | 1147 |
| |
1149 | 1148 |
| |
1150 | 1149 |
| |
1151 |
| - | |
| 1150 | + | |
1152 | 1151 |
| |
1153 | 1152 |
| |
1154 | 1153 |
| |
|
Lines changed: 15 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
38 | 51 |
| |
39 | 52 |
| |
40 | 53 |
| |
| |||
241 | 254 |
| |
242 | 255 |
| |
243 | 256 |
| |
244 |
| - | |
245 |
| - | |
| 257 | + | |
| 258 | + | |
246 | 259 |
| |
247 | 260 |
| |
248 | 261 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
99 | 99 |
| |
100 | 100 |
| |
101 | 101 |
| |
102 |
| - | |
| 102 | + | |
103 | 103 |
| |
104 | 104 |
| |
105 | 105 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
292 | 292 |
| |
293 | 293 |
| |
294 | 294 |
| |
295 |
| - | |
| 295 | + | |
296 | 296 |
| |
297 | 297 |
| |
298 | 298 |
| |
| |||
447 | 447 |
| |
448 | 448 |
| |
449 | 449 |
| |
450 |
| - | |
| 450 | + | |
451 | 451 |
| |
452 | 452 |
| |
453 | 453 |
| |
|
Lines changed: 6 additions & 29 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
332 | 332 |
| |
333 | 333 |
| |
334 | 334 |
| |
335 |
| - | |
336 |
| - | |
337 |
| - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
338 | 338 |
| |
339 | 339 |
| |
340 | 340 |
| |
341 |
| - | |
342 |
| - | |
| 341 | + | |
343 | 342 |
| |
344 | 343 |
| |
345 | 344 |
| |
| |||
1145 | 1144 |
| |
1146 | 1145 |
| |
1147 | 1146 |
| |
1148 |
| - | |
1149 |
| - | |
| 1147 | + | |
| 1148 | + | |
1150 | 1149 |
| |
1151 | 1150 |
| |
1152 | 1151 |
| |
| |||
1164 | 1163 |
| |
1165 | 1164 |
| |
1166 | 1165 |
| |
1167 |
| - | |
1168 |
| - | |
1169 |
| - | |
1170 |
| - | |
1171 |
| - | |
1172 |
| - | |
1173 |
| - | |
1174 |
| - | |
1175 |
| - | |
1176 |
| - | |
1177 |
| - | |
1178 |
| - | |
1179 |
| - | |
1180 |
| - | |
1181 |
| - | |
1182 |
| - | |
1183 | 1166 |
| |
1184 | 1167 |
| |
1185 | 1168 |
| |
| |||
2079 | 2062 |
| |
2080 | 2063 |
| |
2081 | 2064 |
| |
2082 |
| - | |
2083 |
| - | |
2084 |
| - | |
2085 |
| - | |
2086 |
| - | |
2087 |
| - | |
2088 | 2065 |
| |
2089 | 2066 |
| |
2090 | 2067 |
| |
|
Lines changed: 9 additions & 32 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
129 | 129 |
| |
130 | 130 |
| |
131 | 131 |
| |
132 |
| - | |
133 |
| - | |
134 |
| - | |
135 |
| - | |
136 |
| - | |
137 |
| - | |
138 |
| - | |
139 | 132 |
| |
140 | 133 |
| |
141 | 134 |
| |
| |||
185 | 178 |
| |
186 | 179 |
| |
187 | 180 |
| |
188 |
| - | |
189 |
| - | |
190 |
| - | |
191 |
| - | |
192 |
| - | |
193 |
| - | |
194 |
| - | |
195 |
| - | |
196 |
| - | |
197 |
| - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
198 | 190 |
| |
199 | 191 |
| |
200 | 192 |
| |
| |||
4048 | 4040 |
| |
4049 | 4041 |
| |
4050 | 4042 |
| |
4051 |
| - | |
4052 |
| - | |
4053 |
| - | |
4054 |
| - | |
4055 |
| - | |
4056 |
| - | |
4057 |
| - | |
4058 |
| - | |
4059 |
| - | |
4060 |
| - | |
4061 |
| - | |
4062 |
| - | |
4063 |
| - | |
4064 |
| - | |
4065 |
| - | |
4066 | 4043 |
| |
4067 | 4044 |
| |
4068 | 4045 |
| |
|
0 commit comments
Comments
(0)