mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
Fix placement of "SET row_security" command issuance in pg_dump.
Somebody apparently threw darts at the code to decide where to insert these. They certainly didn't proceed by adding them where other similar SETs were handled. This at least broke pg_restore, and perhaps other use-cases too.
This commit is contained in:
@@ -434,17 +434,6 @@ RestoreArchive(Archive *AHX)
|
||||
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.
|
||||
*/
|
||||
@@ -2804,6 +2793,12 @@ _doSetFixedOutputState(ArchiveHandle *AH)
|
||||
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");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user