Re: Proposed patch: synchronized_scanning GUC variable

Russell Smith <mr-russ@pws.com.au>

From: Russell Smith <mr-russ@pws.com.au>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-patches@postgreSQL.org
Date: 2008-01-28T06:27:46Z
Lists: pgsql-hackers
Tom Lane wrote:
> Per today's -hackers discussion, add a GUC variable 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.  This is a
> pretty trivial patch, but seeing how late we are in the 8.3 release
> cycle, I thought I'd better post it for comment anyway.
>
> 			regards, tom lane
>   
>   
> Index: src/bin/pg_dump/pg_dump.c
> ===================================================================
> RCS file: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v
> retrieving revision 1.481
> diff -c -r1.481 pg_dump.c
> *** src/bin/pg_dump/pg_dump.c	1 Jan 2008 19:45:55 -0000	1.481
> --- src/bin/pg_dump/pg_dump.c	27 Jan 2008 20:00:18 -0000
> ***************
> *** 553,558 ****
> --- 553,572 ----
>   	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 synchronized_scanning TO off");
> + 
> + 	/*
>   	 * Start serializable transaction to dump consistent data.
>   	 */
>   	do_sql_command(g_conn, "BEGIN");
>   
Hi,

Can somebody explain why it's important to load with 
synchronized_scanning off?

do_sql_command(g_conn, "SET synchronized_scanning TO off");

Thanks

Russell Smith