mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-24 18:55:04 +08:00
Use SET TRANSACTION READ ONLY in pg_dump, if server supports it.
This currently does little except serve as documentation. (The one case where it has a performance benefit, SERIALIZABLE mode in 9.1 and up, was already using READ ONLY mode.) However, it's possible that it might have performance benefits in future, and in any case it seems like good practice since it would catch any accidentally non-read-only operations. Pavan Deolasee
This commit is contained in:
parent
4b94cfb564
commit
26d905a12d
@ -618,7 +618,14 @@ main(int argc, char **argv)
|
||||
else
|
||||
ExecuteSqlStatement(fout,
|
||||
"SET TRANSACTION ISOLATION LEVEL "
|
||||
"REPEATABLE READ");
|
||||
"REPEATABLE READ, READ ONLY");
|
||||
}
|
||||
else if (fout->remoteVersion >= 70400)
|
||||
{
|
||||
/* note: comma was not accepted in SET TRANSACTION before 8.0 */
|
||||
ExecuteSqlStatement(fout,
|
||||
"SET TRANSACTION ISOLATION LEVEL "
|
||||
"SERIALIZABLE READ ONLY");
|
||||
}
|
||||
else
|
||||
ExecuteSqlStatement(fout,
|
||||
|
Loading…
Reference in New Issue
Block a user