1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

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.
This commit is contained in:
Alvaro Herrera
2009-02-02 19:31:40 +00:00
parent 80f95a6500
commit 3a5b773715
27 changed files with 455 additions and 130 deletions

View File

@ -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
{