ahprintf(AH, "BEGIN;\n\n");
}
- /*
- * Enable row-security if necessary.
- */
- if (PQserverVersion(AH->connection) >= 90500)
- {
- if (!ropt->enable_row_security)
- ahprintf(AH, "SET row_security = off;\n");
- else
- ahprintf(AH, "SET row_security = on;\n");
- }
-
/*
* Establish important parameter values right away.
*/
if (!AH->public.std_strings)
ahprintf(AH, "SET escape_string_warning = off;\n");
+ /* Adjust row-security state */
+ if (AH->ropt && AH->ropt->enable_row_security)
+ ahprintf(AH, "SET row_security = on;\n");
+ else
+ ahprintf(AH, "SET row_security = off;\n");
+
ahprintf(AH, "\n");
}
if (quote_all_identifiers && AH->remoteVersion >= 90100)
ExecuteSqlStatement(AH, "SET quote_all_identifiers = true");
+ /*
+ * Adjust row-security mode, if supported.
+ */
+ if (AH->remoteVersion >= 90500)
+ {
+ if (dopt->enable_row_security)
+ ExecuteSqlStatement(AH, "SET row_security = on");
+ else
+ ExecuteSqlStatement(AH, "SET row_security = off");
+ }
+
/*
* Start transaction-snapshot mode transaction to dump consistent data.
*/
AH->remoteVersion >= 90200 &&
!dopt->no_synchronized_snapshots)
AH->sync_snapshot_id = get_synchronized_snapshot(AH);
-
- if (AH->remoteVersion >= 90500)
- {
- if (dopt->enable_row_security)
- ExecuteSqlStatement(AH, "SET row_security TO ON");
- else
- ExecuteSqlStatement(AH, "SET row_security TO OFF");
- }
}
static void