Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit26d905a

Browse files
committed
Use SET TRANSACTION READ ONLY in pg_dump, if server supports it.
This currently does little except serve as documentation. (The one casewhere it has a performance benefit, SERIALIZABLE mode in 9.1 and up, wasalready using READ ONLY mode.) However, it's possible that it might haveperformance benefits in future, and in any case it seems like goodpractice since it would catch any accidentally non-read-only operations.Pavan Deolasee
1 parent4b94cfb commit26d905a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,14 @@ main(int argc, char **argv)
618618
else
619619
ExecuteSqlStatement(fout,
620620
"SET TRANSACTION ISOLATION LEVEL "
621-
"REPEATABLE READ");
621+
"REPEATABLE READ, READ ONLY");
622+
}
623+
elseif (fout->remoteVersion >=70400)
624+
{
625+
/* note: comma was not accepted in SET TRANSACTION before 8.0 */
626+
ExecuteSqlStatement(fout,
627+
"SET TRANSACTION ISOLATION LEVEL "
628+
"SERIALIZABLE READ ONLY");
622629
}
623630
else
624631
ExecuteSqlStatement(fout,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp