aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2016-12-23 07:35:01 -0500
committerRobert Haas <rhaas@postgresql.org>2016-12-23 07:35:01 -0500
commite13486eba05cc46951a34263d19b65d1eca0176b (patch)
tree5f1a87dbd28446b5c04b38e912998e75e9da2569 /src/backend/parser
parent7819ba1ef6c5297b7e27878d2b3d30c5bcef8939 (diff)
downloadpostgresql-e13486eba05cc46951a34263d19b65d1eca0176b.tar.gz
postgresql-e13486eba05cc46951a34263d19b65d1eca0176b.zip
Remove sql_inheritance GUC.
This backward-compatibility GUC is long overdue for removal. Discussion: http://postgr.es/m/CA+TgmoYe+EG7LdYX6pkcNxr4ygkP4+A=jm9o-CPXyOvRiCNwaQ@mail.gmail.com
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/analyze.c4
-rw-r--r--src/backend/parser/gram.y9
-rw-r--r--src/backend/parser/parse_clause.c26
3 files changed, 7 insertions, 32 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index 5e65fe75bd5..601e22abfa3 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -380,7 +380,7 @@ transformDeleteStmt(ParseState *pstate, DeleteStmt *stmt)
/* set up range table with just the result rel */
qry->resultRelation = setTargetTable(pstate, stmt->relation,
- interpretInhOption(stmt->relation->inhOpt),
+ (stmt->relation->inhOpt == INH_YES),
true,
ACL_DELETE);
@@ -2177,7 +2177,7 @@ transformUpdateStmt(ParseState *pstate, UpdateStmt *stmt)
}
qry->resultRelation = setTargetTable(pstate, stmt->relation,
- interpretInhOption(stmt->relation->inhOpt),
+ (stmt->relation->inhOpt == INH_YES),
true,
ACL_UPDATE);
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 2ed7b5259d0..931bc9aca68 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -28,12 +28,11 @@
* current transaction and are just parsing commands to find the next
* ROLLBACK or COMMIT. If you make use of SET variables, then you
* will do the wrong thing in multi-query strings like this:
- * SET SQL_inheritance TO off; SELECT * FROM foo;
+ * SET constraint_exclusion TO off; SELECT * FROM foo;
* because the entire string is parsed by gram.y before the SET gets
* executed. Anything that depends on the database or changeable state
* should be handled during parse analysis so that it happens at the
- * right time not the wrong time. The handling of SQL_inheritance is
- * a good example.
+ * right time not the wrong time.
*
* WARNINGS
* If you use a list, make sure the datum is a node so that the printing
@@ -11249,9 +11248,9 @@ join_qual: USING '(' name_list ')' { $$ = (Node *) $3; }
relation_expr:
qualified_name
{
- /* default inheritance */
+ /* inheritance query, implicitly */
$$ = $1;
- $$->inhOpt = INH_DEFAULT;
+ $$->inhOpt = INH_YES;
$$->alias = NULL;
}
| qualified_name '*'
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index 751de4bddb5..a96b3f92809 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -229,30 +229,6 @@ setTargetTable(ParseState *pstate, RangeVar *relation,
}
/*
- * Simplify InhOption (yes/no/default) into boolean yes/no.
- *
- * The reason we do things this way is that we don't want to examine the
- * SQL_inheritance option flag until parse_analyze() is run. Otherwise,
- * we'd do the wrong thing with query strings that intermix SET commands
- * with queries.
- */
-bool
-interpretInhOption(InhOption inhOpt)
-{
- switch (inhOpt)
- {
- case INH_NO:
- return false;
- case INH_YES:
- return true;
- case INH_DEFAULT:
- return SQL_inheritance;
- }
- elog(ERROR, "bogus InhOption value: %d", inhOpt);
- return false; /* keep compiler quiet */
-}
-
-/*
* Given a relation-options list (of DefElems), return true iff the specified
* table/result set should be created with OIDs. This needs to be done after
* parsing the query string because the return value can depend upon the
@@ -437,7 +413,7 @@ transformTableEntry(ParseState *pstate, RangeVar *r)
/* We need only build a range table entry */
rte = addRangeTableEntry(pstate, r, r->alias,
- interpretInhOption(r->inhOpt), true);
+ (r->inhOpt == INH_YES), true);
return rte;
}