diff options
author | Robert Haas <rhaas@postgresql.org> | 2017-09-08 17:28:04 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2017-09-08 17:28:04 -0400 |
commit | 6f6b99d1335be8ea1b74581fc489a97b109dd08a (patch) | |
tree | 2aaa59a9c8759a3195e7c1c27e96725ae3df944f /src/backend/parser/parse_utilcmd.c | |
parent | 2cf15ec8b1cb29bea149559700566a21a790b6d3 (diff) | |
download | postgresql-6f6b99d1335be8ea1b74581fc489a97b109dd08a.tar.gz postgresql-6f6b99d1335be8ea1b74581fc489a97b109dd08a.zip |
Allow a partitioned table to have a default partition.
Any tuples that don't route to any other partition will route to the
default partition.
Jeevan Ladhe, Beena Emerson, Ashutosh Bapat, Rahila Syed, and Robert
Haas, with review and testing at various stages by (at least) Rushabh
Lathia, Keith Fiske, Amit Langote, Amul Sul, Rajkumar Raghuanshi, Sven
Kunze, Kyotaro Horiguchi, Thom Brown, Rafia Sabih, and Dilip Kumar.
Discussion: http://postgr.es/m/CAH2L28tbN4SYyhS7YV1YBWcitkqbhSWfQCy0G=apRcC_PEO-bg@mail.gmail.com
Discussion: http://postgr.es/m/CAOG9ApEYj34fWMcvBMBQ-YtqR9fTdXhdN82QEKG0SVZ6zeL1xg@mail.gmail.com
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
-rw-r--r-- | src/backend/parser/parse_utilcmd.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 20586797cc5..655da02c109 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -3307,6 +3307,18 @@ transformPartitionBound(ParseState *pstate, Relation parent, /* Avoid scribbling on input */ result_spec = copyObject(spec); + if (spec->is_default) + { + /* + * In case of the default partition, parser had no way to identify the + * partition strategy. Assign the parent's strategy to the default + * partition bound spec. + */ + result_spec->strategy = strategy; + + return result_spec; + } + if (strategy == PARTITION_STRATEGY_LIST) { ListCell *cell; |