Oops, forgot to "git add" one last change
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 25 Aug 2014 19:32:06 +0000 (15:32 -0400)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 25 Aug 2014 19:32:06 +0000 (15:32 -0400)
src/backend/commands/tablecmds.c

index 56915c4fe389083e217bfe2cc0ad2b311d92c240..3720a0fe56300bcab1442e672c31fee1f725c34e 100644 (file)
@@ -3175,19 +3175,23 @@ ATPrepCmd(List **wqueue, Relation rel, AlterTableCmd *cmd,
        case AT_SetLogged:      /* SET LOGGED */
            ATSimplePermissions(rel, ATT_TABLE);
            tab->chgPersistence = ATPrepChangePersistence(rel, true);
-           tab->newrelpersistence = RELPERSISTENCE_PERMANENT;
-           /* force rewrite if necessary */
+           /* force rewrite if necessary; see comment in ATRewriteTables */
            if (tab->chgPersistence)
+           {
                tab->rewrite = true;
+               tab->newrelpersistence = RELPERSISTENCE_PERMANENT;
+           }
            pass = AT_PASS_MISC;
            break;
        case AT_SetUnLogged:    /* SET UNLOGGED */
            ATSimplePermissions(rel, ATT_TABLE);
            tab->chgPersistence = ATPrepChangePersistence(rel, false);
-           tab->newrelpersistence = RELPERSISTENCE_UNLOGGED;
-           /* force rewrite if necessary */
+           /* force rewrite if necessary; see comment in ATRewriteTables */
            if (tab->chgPersistence)
+           {
                tab->rewrite = true;
+               tab->newrelpersistence = RELPERSISTENCE_UNLOGGED;
+           }
            pass = AT_PASS_MISC;
            break;
        case AT_AddOids:        /* SET WITH OIDS */