From 5e66a51c2eebaad4c0d78e3f776d74b2c5a0d1bc Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 16 Nov 2009 21:32:07 +0000 Subject: Provide a parenthesized-options syntax for VACUUM, analogous to that recently adopted for EXPLAIN. This will allow additional options to be implemented in future without having to make them fully-reserved keywords. The old syntax remains available for existing options, however. Itagaki Takahiro --- src/backend/commands/analyze.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/backend/commands/analyze.c') diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c index 38cf57aba0..ab1fe9bf0e 100644 --- a/src/backend/commands/analyze.c +++ b/src/backend/commands/analyze.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.141 2009/08/12 18:23:49 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/analyze.c,v 1.142 2009/11/16 21:32:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -135,7 +135,7 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt, Oid save_userid; bool save_secdefcxt; - if (vacstmt->verbose) + if (vacstmt->options & VACOPT_VERBOSE) elevel = INFO; else elevel = DEBUG2; @@ -173,7 +173,7 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt, (pg_database_ownercheck(MyDatabaseId, GetUserId()) && !onerel->rd_rel->relisshared))) { /* No need for a WARNING if we already complained during VACUUM */ - if (!vacstmt->vacuum) + if (!(vacstmt->options & VACOPT_VACUUM)) { if (onerel->rd_rel->relisshared) ereport(WARNING, @@ -199,7 +199,7 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt, if (onerel->rd_rel->relkind != RELKIND_RELATION) { /* No need for a WARNING if we already complained during VACUUM */ - if (!vacstmt->vacuum) + if (!(vacstmt->options & VACOPT_VACUUM)) ereport(WARNING, (errmsg("skipping \"%s\" --- cannot analyze indexes, views, or special system tables", RelationGetRelationName(onerel)))); @@ -475,7 +475,7 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt, * VACUUM ANALYZE, don't overwrite the accurate count already inserted by * VACUUM. */ - if (!vacstmt->vacuum) + if (!(vacstmt->options & VACOPT_VACUUM)) { for (ind = 0; ind < nindexes; ind++) { @@ -493,7 +493,7 @@ analyze_rel(Oid relid, VacuumStmt *vacstmt, cleanup: /* If this isn't part of VACUUM ANALYZE, let index AMs do cleanup */ - if (!vacstmt->vacuum) + if (!(vacstmt->options & VACOPT_VACUUM)) { for (ind = 0; ind < nindexes; ind++) { -- cgit v1.2.1