1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Add a GUC variable "synchronize_seqscans" to allow clients to disable the new

synchronized-scanning behavior, and make pg_dump disable sync scans so that
it will reliably preserve row ordering.  Per recent discussions.
This commit is contained in:
Tom Lane
2008-01-30 18:35:55 +00:00
parent 6dfa40d69f
commit 47df4f6688
5 changed files with 59 additions and 14 deletions

View File

@@ -12,7 +12,7 @@
* by PostgreSQL
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.481 2008/01/01 19:45:55 momjian Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.482 2008/01/30 18:35:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -552,6 +552,20 @@ main(int argc, char **argv)
/* Set the datestyle to ISO to ensure the dump's portability */
do_sql_command(g_conn, "SET DATESTYLE = ISO");
/*
* If supported, set extra_float_digits so that we can dump float data
* exactly (given correctly implemented float I/O code, anyway)
*/
if (g_fout->remoteVersion >= 70400)
do_sql_command(g_conn, "SET extra_float_digits TO 2");
/*
* If synchronized scanning is supported, disable it, to prevent
* unpredictable changes in row ordering across a dump and reload.
*/
if (g_fout->remoteVersion >= 80300)
do_sql_command(g_conn, "SET synchronize_seqscans TO off");
/*
* Start serializable transaction to dump consistent data.
*/
@@ -567,13 +581,6 @@ main(int argc, char **argv)
else
username_subquery = "SELECT usename FROM pg_user WHERE usesysid =";
/*
* If supported, set extra_float_digits so that we can dump float data
* exactly (given correctly implemented float I/O code, anyway)
*/
if (g_fout->remoteVersion >= 70400)
do_sql_command(g_conn, "SET extra_float_digits TO 2");
/* Find the last built-in OID, if needed */
if (g_fout->remoteVersion < 70300)
{