1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-26 12:21:12 +03:00

REINDEX SCHEMA

Add new SCHEMA option to REINDEX and reindexdb.

Sawada Masahiko

Reviewed by Michael Paquier and Fabrízio de Royes Mello
This commit is contained in:
Simon Riggs
2014-12-09 00:28:00 +09:00
parent 8001fe67a3
commit fe263d115a
12 changed files with 253 additions and 61 deletions

View File

@ -404,7 +404,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
%type <boolean> copy_from opt_program
%type <ival> opt_column event cursor_options opt_hold opt_set_data
%type <objtype> reindex_type drop_type comment_type security_label_type
%type <objtype> drop_type comment_type security_label_type
%type <node> fetch_args limit_clause select_limit_value
offset_clause select_offset_value
@ -7198,41 +7198,48 @@ opt_if_exists: IF_P EXISTS { $$ = TRUE; }
*****************************************************************************/
ReindexStmt:
REINDEX reindex_type qualified_name opt_force
REINDEX INDEX qualified_name opt_force
{
ReindexStmt *n = makeNode(ReindexStmt);
n->kind = $2;
n->kind = REINDEX_OBJECT_INDEX;
n->relation = $3;
n->name = NULL;
$$ = (Node *)n;
}
| REINDEX TABLE qualified_name opt_force
{
ReindexStmt *n = makeNode(ReindexStmt);
n->kind = REINDEX_OBJECT_TABLE;
n->relation = $3;
n->name = NULL;
$$ = (Node *)n;
}
| REINDEX SCHEMA name opt_force
{
ReindexStmt *n = makeNode(ReindexStmt);
n->kind = REINDEX_OBJECT_SCHEMA;
n->name = $3;
n->relation = NULL;
$$ = (Node *)n;
}
| REINDEX SYSTEM_P name opt_force
{
ReindexStmt *n = makeNode(ReindexStmt);
n->kind = OBJECT_DATABASE;
n->kind = REINDEX_OBJECT_SYSTEM;
n->name = $3;
n->relation = NULL;
n->do_system = true;
n->do_user = false;
$$ = (Node *)n;
}
| REINDEX DATABASE name opt_force
{
ReindexStmt *n = makeNode(ReindexStmt);
n->kind = OBJECT_DATABASE;
n->kind = REINDEX_OBJECT_DATABASE;
n->name = $3;
n->relation = NULL;
n->do_system = true;
n->do_user = true;
$$ = (Node *)n;
}
;
reindex_type:
INDEX { $$ = OBJECT_INDEX; }
| TABLE { $$ = OBJECT_TABLE; }
;
opt_force: FORCE { $$ = TRUE; }
| /* EMPTY */ { $$ = FALSE; }
;