Commit 2fbdf1b
committed
Simplify partitioned table creation vs. relcache
In the original code, we were storing the pg_inherits row for a
partitioned table too early: enough that we had a hack for relcache to
avoid falling flat on its face while reading such a partial entry. If
we finish the pg_class creation first and *then* store the pg_inherits
entry, we don't need that hack.
Also recognize that pg_class.relpartbound is not marked NOT NULL and
therefore it's entirely possible to read null values, so having only
Assert() protection isn't enough. Change those to if/elog tests
instead. This qualifies as a robustness fix, so backpatch to pg11.
In passing, remove one access that wasn't actually needed, and reword
one message to be like all the others that check for the same thing.
Reviewed-by: Amit Langote
Discussion: https://postgr.es/m/20180903213916.hh6wasnrdg6xv2ud@alvherre.pgsql1 parent f5a6509 commit 2fbdf1b
File tree
3 files changed
+9
-25
lines changed- src/backend
- commands
- partitioning
- utils/cache
3 files changed
+9
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | 776 | | |
780 | 777 | | |
781 | 778 | | |
| |||
869 | 866 | | |
870 | 867 | | |
871 | 868 | | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
| |||
14703 | 14703 | | |
14704 | 14704 | | |
14705 | 14705 | | |
14706 | | - | |
14707 | | - | |
14708 | | - | |
14709 | | - | |
14710 | 14706 | | |
14711 | 14707 | | |
14712 | 14708 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1641 | 1641 | | |
1642 | 1642 | | |
1643 | 1643 | | |
| 1644 | + | |
| 1645 | + | |
1644 | 1646 | | |
1645 | | - | |
1646 | 1647 | | |
1647 | 1648 | | |
1648 | 1649 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | 305 | | |
319 | 306 | | |
320 | 307 | | |
321 | | - | |
| 308 | + | |
| 309 | + | |
322 | 310 | | |
323 | 311 | | |
324 | 312 | | |
| |||
883 | 871 | | |
884 | 872 | | |
885 | 873 | | |
886 | | - | |
887 | | - | |
888 | | - | |
| 874 | + | |
| 875 | + | |
889 | 876 | | |
890 | 877 | | |
891 | 878 | | |
| |||
0 commit comments