forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1c7c317
committed
Clarify use of temporary tables within partition trees
Since their introduction, partition trees have been a bit lossyregarding temporary relations. Inheritance trees respect the followingpatterns:1) a child relation can be temporary if the parent is permanent.2) a child relation can be temporary if the parent is temporary.3) a child relation cannot be permanent if the parent is temporary.4) The use of temporary relations also imply that when both parent andchild need to be from the same sessions.Partitions share many similar patterns with inheritance, however thehandling of the partition bounds make the situation a bit tricky forcase 1) as the partition code bases a lot of its lookup code uponPartitionDesc which does not really look after relpersistence. Thiscauses for example a temporary partition created by session A to bevisible by another session B, preventing this session B to create anextra partition which overlaps with the temporary one created by A witha non-intuitive error message. There could be use-cases where mixingpermanent partitioned tables with temporary partitions make sense, butthat would be a new feature. Partitions respect 2), 3) and 4) already.It is a bit depressing to see those error checks happening inMergeAttributes() whose purpose is different, but that's left as futurerefactoring work.Back-patch down to 10, which is where partitioning has been introduced,except that default partitions do not apply there. Documentation alsoincludes limitations related to the use of temporary tables withpartition trees.Reported-by: David RowleyAuthor: Amit Langote, Michael PaquierReviewed-by: Ashutosh Bapat, Amit Langote, Michael PaquierDiscussion:https://postgr.es/m/CAKJS1f94Ojk0og9GMkRHGt8wHTW=ijq5KzJKuoBoqWLwSVwGmw@mail.gmail.com1 parentc992dca commit1c7c317
File tree
10 files changed
+125
-0
lines changed- doc/src/sgml
- src
- backend/commands
- test/regress
- expected
- sql
10 files changed
+125
-0
lines changedLines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3353 | 3353 |
| |
3354 | 3354 |
| |
3355 | 3355 |
| |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
3356 | 3366 |
| |
3357 | 3367 |
| |
3358 | 3368 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1985 | 1985 |
| |
1986 | 1986 |
| |
1987 | 1987 |
| |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
1988 | 2001 |
| |
1989 | 2002 |
| |
1990 | 2003 |
| |
| |||
14135 | 14148 |
| |
14136 | 14149 |
| |
14137 | 14150 |
| |
| 14151 | + | |
| 14152 | + | |
| 14153 | + | |
| 14154 | + | |
| 14155 | + | |
| 14156 | + | |
| 14157 | + | |
| 14158 | + | |
14138 | 14159 |
| |
14139 | 14160 |
| |
14140 | 14161 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3894 | 3894 |
| |
3895 | 3895 |
| |
3896 | 3896 |
| |
| 3897 | + | |
| 3898 | + | |
| 3899 | + | |
| 3900 | + | |
| 3901 | + | |
| 3902 | + | |
| 3903 | + | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
| 3909 | + |
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
899 | 899 |
| |
900 | 900 |
| |
901 | 901 |
| |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + |
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2045 | 2045 |
| |
2046 | 2046 |
| |
2047 | 2047 |
| |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
2048 | 2059 |
| |
2049 | 2060 |
| |
2050 | 2061 |
| |
|
Lines changed: 21 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3086 | 3086 |
| |
3087 | 3087 |
| |
3088 | 3088 |
| |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
| 3106 | + | |
| 3107 | + | |
| 3108 | + | |
| 3109 | + |
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2573 | 2573 |
| |
2574 | 2574 |
| |
2575 | 2575 |
| |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + |
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
726 | 726 |
| |
727 | 727 |
| |
728 | 728 |
| |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + |
Lines changed: 10 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
805 | 805 |
| |
806 | 806 |
| |
807 | 807 |
| |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
808 | 818 |
| |
809 | 819 |
| |
810 | 820 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
813 | 813 |
| |
814 | 814 |
| |
815 | 815 |
| |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + |
0 commit comments
Comments
(0)