From 47df4f668826c0646ae30d37971e4ff15e77b3e3 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 30 Jan 2008 18:35:55 +0000 Subject: 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. --- src/bin/pg_dump/pg_dump.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/bin') diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 3e53a64cd46..c284bbb2da9 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -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) { -- cgit v1.2.3