diff options
author | Michael Paquier <michael@paquier.xyz> | 2019-11-14 12:34:28 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2019-11-14 12:34:28 +0900 |
commit | 1bbd608fdae7af314d8e2229e369a45a3da83cd8 (patch) | |
tree | 55d1a7d30a68b134f0326a0a4aee9e0a08bda800 /src/backend/commands/tablecmds.c | |
parent | 80ef34fc7075b37fc23f4ab714a5ce60f82400de (diff) | |
download | postgresql-1bbd608fdae7af314d8e2229e369a45a3da83cd8.tar.gz postgresql-1bbd608fdae7af314d8e2229e369a45a3da83cd8.zip |
Split handling of reloptions for partitioned tables
Partitioned tables do not have relation options yet, but, similarly to
what's done for views which have their own parsing table, it could make
sense to introduce new parameters for some of the existing default ones
like fillfactor, autovacuum, etc. Splitting things has the advantage to
make the information stored in rd_options include only the necessary
information, reducing the amount of memory used for a relcache entry
with partitioned tables if new reloptions are introduced at this level.
Author: Nikolay Shaplov
Reviewed-by: Amit Langote, Michael Paquier
Discussion: https://postgr.es/m/1627387.Qykg9O6zpu@x200m
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r-- | src/backend/commands/tablecmds.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 496c2063329..45aae5955d0 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -719,10 +719,17 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, reloptions = transformRelOptions((Datum) 0, stmt->options, NULL, validnsps, true, false); - if (relkind == RELKIND_VIEW) - (void) view_reloptions(reloptions, true); - else - (void) heap_reloptions(relkind, reloptions, true); + switch (relkind) + { + case RELKIND_VIEW: + (void) view_reloptions(reloptions, true); + break; + case RELKIND_PARTITIONED_TABLE: + (void) partitioned_table_reloptions(reloptions, true); + break; + default: + (void) heap_reloptions(relkind, reloptions, true); + } if (stmt->ofTypename) { @@ -12187,9 +12194,11 @@ ATExecSetRelOptions(Relation rel, List *defList, AlterTableType operation, case RELKIND_RELATION: case RELKIND_TOASTVALUE: case RELKIND_MATVIEW: - case RELKIND_PARTITIONED_TABLE: (void) heap_reloptions(rel->rd_rel->relkind, newOptions, true); break; + case RELKIND_PARTITIONED_TABLE: + (void) partitioned_table_reloptions(newOptions, true); + break; case RELKIND_VIEW: (void) view_reloptions(newOptions, true); break; |