diff options
author | Robert Haas <rhaas@postgresql.org> | 2018-03-22 13:49:38 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2018-03-22 13:49:38 -0400 |
commit | 2fe6336e2d48d77fca6d0849f03c0faa06725159 (patch) | |
tree | f4182dafdebac602bc65bb16b2af1a14c8a204df /src | |
parent | 8a8c4f3b325ea00cc4ffb106a71e65e79c5d7af9 (diff) | |
download | postgresql-2fe6336e2d48d77fca6d0849f03c0faa06725159.tar.gz postgresql-2fe6336e2d48d77fca6d0849f03c0faa06725159.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/catalog/toasting.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c index c4515e6c1d1..9007dc6ebe5 100644 --- a/src/backend/catalog/toasting.c +++ b/src/backend/catalog/toasting.c @@ -397,6 +397,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid, * (1) there are any toastable attributes, and (2) the maximum length * of a tuple could exceed TOAST_TUPLE_THRESHOLD. (We don't want to * create a toast table for something like "f1 varchar(20)".) + * No need to create a TOAST table for partitioned tables. */ static bool needs_toast_table(Relation rel) @@ -408,6 +409,9 @@ needs_toast_table(Relation rel) int32 tuple_length; int i; + if (rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) + return false; + tupdesc = rel->rd_att; for (i = 0; i < tupdesc->natts; i++) |