1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

Replace enum InhOption with simple boolean.

Now that it has only INH_NO and INH_YES values, it's just weird that
it's not a plain bool, so make it that way.

Also rename RangeVar.inhOpt to "inh", to be like RangeTblEntry.inh.
My recollection is that we gave it a different name specifically because
it had a different representation than the derived bool value, but it
no longer does.  And this is a good forcing function to be sure we
catch any places that are affected by the change.

Bump catversion because of possible effect on stored RangeVar nodes.
I'm not exactly convinced that we ever store RangeVar on disk, but
we have a readfuncs function for it, so be cautious.  (If we do do so,
then commit e13486eba was in error not to bump catversion.)

Follow-on to commit e13486eba.

Discussion: http://postgr.es/m/CA+TgmoYe+EG7LdYX6pkcNxr4ygkP4+A=jm9o-CPXyOvRiCNwaQ@mail.gmail.com
This commit is contained in:
Tom Lane
2016-12-23 13:35:11 -05:00
parent 158df30359
commit fe591f8bf6
12 changed files with 22 additions and 31 deletions

View File

@ -1184,7 +1184,7 @@ ExecuteTruncate(TruncateStmt *stmt)
{
RangeVar *rv = lfirst(cell);
Relation rel;
bool recurse = (rv->inhOpt == INH_YES);
bool recurse = rv->inh;
Oid myrelid;
rel = heap_openrv(rv, AccessExclusiveLock);
@ -2655,7 +2655,7 @@ renameatt(RenameStmt *stmt)
renameatt_internal(relid,
stmt->subname, /* old att name */
stmt->newname, /* new att name */
(stmt->relation->inhOpt == INH_YES), /* recursive? */
stmt->relation->inh, /* recursive? */
false, /* recursing? */
0, /* expected inhcount */
stmt->behavior);
@ -2807,7 +2807,8 @@ RenameConstraint(RenameStmt *stmt)
rename_constraint_internal(relid, typid,
stmt->subname,
stmt->newname,
(stmt->relation && stmt->relation->inhOpt == INH_YES), /* recursive? */
(stmt->relation &&
stmt->relation->inh), /* recursive? */
false, /* recursing? */
0 /* expected inhcount */ );
@ -3049,9 +3050,7 @@ AlterTable(Oid relid, LOCKMODE lockmode, AlterTableStmt *stmt)
CheckTableNotInUse(rel, "ALTER TABLE");
ATController(stmt,
rel, stmt->cmds, (stmt->relation->inhOpt == INH_YES),
lockmode);
ATController(stmt, rel, stmt->cmds, stmt->relation->inh, lockmode);
}
/*