Skip to content

Commit 4827d9f

Browse files
committed
create partition in parent's tablespace by default
1 parent 86292dc commit 4827d9f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/partition_creation.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "commands/event_trigger.h"
2525
#include "commands/sequence.h"
2626
#include "commands/tablecmds.h"
27+
#include "commands/tablespace.h"
2728
#include "miscadmin.h"
2829
#include "parser/parse_func.h"
2930
#include "parser/parse_relation.h"
@@ -549,6 +550,10 @@ create_single_partition_internal(Oid parent_relid,
549550
partition_rv = makeRangeVar(parent_nsp_name, part_name, -1);
550551
}
551552

553+
/* If no 'tablespace' is provided, get parent's tablespace */
554+
if (!tablespace)
555+
tablespace = get_tablespace_name(get_rel_tablespace(parent_relid));
556+
552557
/* Initialize TableLikeClause structure */
553558
NodeSetTag(&like_clause, T_TableLikeClause);
554559
like_clause.relation = copyObject(parent_rv);

0 commit comments

Comments
 (0)