diff options
| author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2009-02-02 19:31:40 +0000 |
|---|---|---|
| committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2009-02-02 19:31:40 +0000 |
| commit | 3a5b77371522b64feda006a7aed2a0e57bfb2b22 (patch) | |
| tree | 2a3660571ea184c8e40a78608839914af4f2bb27 /src/backend/tcop/utility.c | |
| parent | 80f95a6500d7f5762e4701c80eb202c3fce9095f (diff) | |
| download | postgresql-3a5b77371522b64feda006a7aed2a0e57bfb2b22.tar.gz | |
Allow reloption names to have qualifiers, initially supporting a TOAST
qualifier, and add support for this in pg_dump.
This allows TOAST tables to have user-defined fillfactor, and will also
enable us to move the autovacuum parameters to reloptions without taking
away the possibility of setting values for TOAST tables.
Diffstat (limited to 'src/backend/tcop/utility.c')
| -rw-r--r-- | src/backend/tcop/utility.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 7e7d07e4f0..6c6b13e17e 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -10,12 +10,13 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.305 2009/01/22 20:16:06 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.306 2009/02/02 19:31:39 alvherre Exp $ * *------------------------------------------------------------------------- */ #include "postgres.h" +#include "access/reloptions.h" #include "access/twophase.h" #include "access/xact.h" #include "catalog/catalog.h" @@ -422,6 +423,9 @@ ProcessUtility(Node *parsetree, if (IsA(stmt, CreateStmt)) { + Datum toast_options; + static char *validnsps[] = HEAP_RELOPT_NAMESPACES; + /* Create the table itself */ relOid = DefineRelation((CreateStmt *) stmt, RELKIND_RELATION); @@ -431,7 +435,17 @@ ProcessUtility(Node *parsetree, * needs a secondary relation too. */ CommandCounterIncrement(); - AlterTableCreateToastTable(relOid); + + /* parse and validate reloptions for the toast table */ + toast_options = transformRelOptions((Datum) 0, + ((CreateStmt *)stmt)->options, + "toast", + validnsps, + true, false); + (void) heap_reloptions(RELKIND_TOASTVALUE, toast_options, + true); + + AlterTableCreateToastTable(relOid, toast_options); } else { |
