diff options
| author | Tom Lane | 2008-01-30 18:35:55 +0000 |
|---|---|---|
| committer | Tom Lane | 2008-01-30 18:35:55 +0000 |
| commit | 47df4f668826c0646ae30d37971e4ff15e77b3e3 (patch) | |
| tree | 2cde488d111ebeb6d3f99e78c1f42270ba337777 /src/bin | |
| parent | 6dfa40d69f17d86cedd0e630312b4103dac5f8b6 (diff) | |
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.
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/pg_dump/pg_dump.c | 23 |
1 files changed, 15 insertions, 8 deletions
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 $ * *------------------------------------------------------------------------- */ @@ -553,6 +553,20 @@ main(int argc, char **argv) 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. */ do_sql_command(g_conn, "BEGIN"); @@ -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) { |
