Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2fe6336

Browse files
committed
Avoid creating a TOAST table for a partitioned table.
It's useless. Amit Langote Discussion: http://postgr.es/m/b4c9dee6-d134-49b8-79c4-07fbd7c3b898@lab.ntt.co.jp
1 parent 8a8c4f3 commit 2fe6336

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/backend/catalog/toasting.c

+4
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
397397
* (1) there are any toastable attributes, and (2) the maximum length
398398
* of a tuple could exceed TOAST_TUPLE_THRESHOLD. (We don't want to
399399
* create a toast table for something like "f1 varchar(20)".)
400+
* No need to create a TOAST table for partitioned tables.
400401
*/
401402
static bool
402403
needs_toast_table(Relation rel)
@@ -408,6 +409,9 @@ needs_toast_table(Relation rel)
408409
int32 tuple_length;
409410
int i;
410411

412+
if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
413+
return false;
414+
411415
tupdesc = rel->rd_att;
412416

413417
for (i = 0; i < tupdesc->natts; i++)

0 commit comments

Comments
 (0)