Apologies.  Turns out the name of the relevant setting was changed for 8.3! So a revised patch is attached.

For backing, see:
http://www.postgresql.org/docs/8.3/static/release-8-3.html
" Numerous changes in administrative server parameters...
stats_block_level and stats_row_level are merged into track_counts."


Bruce Momjian wrote:
Bryce Nesbitt wrote:
  
This is a proposed patch to document disabling the statistics collector 
pg_dump activity, and give a bit more visibility to the PGOPTIONS 
environment variable supported by libpq.

It is an alternative to the prior patch, which supplied a --no-stats flag.

This is a documentation only patch, not tied to a recent code change.
    

Patch applied, with spelling correction already noted.
  

Index: pg_dump.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v
retrieving revision 1.514
diff -c -2 -r1.514 pg_dump.c
*** pg_dump.c	18 Jan 2009 20:44:45 -0000	1.514
--- pg_dump.c	20 Jan 2009 20:47:25 -0000
***************
*** 236,239 ****
--- 236,240 ----
  	static int  outputNoTablespaces = 0;
  	static int	use_setsessauth = 0;
+ 	static int  noStatsCollection = 0;
  
  	static struct option long_options[] = {
***************
*** 278,281 ****
--- 279,283 ----
  		{"role", required_argument, NULL, 3},
  		{"use-set-session-authorization", no_argument, &use_setsessauth, 1},
+ 		{"no-stats", no_argument, &noStatsCollection, 1},
  
  		{NULL, 0, NULL, 0}
***************
*** 430,433 ****
--- 432,437 ----
  				else if (strcmp(optarg, "no-tablespaces") == 0)
  					outputNoTablespaces = 1;
+ 				else if (strcmp(optarg, "no-stats") == 0)
+ 					noStatsCollection = 1;
  				else if (strcmp(optarg, "use-set-session-authorization") == 0)
  					use_setsessauth = 1;
***************
*** 613,616 ****
--- 617,629 ----
  		do_sql_command(g_conn, "SET statement_timeout = 0");
  
+	/* 
+	 * Disable collection of statistics.  pg_dump's activity may be very different
+	 * from what you are trying to analyze in the stats tables.
+	 */
+ 	if( noStatsCollection ) {
+ 		do_sql_command(g_conn, "SET stats_block_level = false");
+ 		do_sql_command(g_conn, "SET stats_row_level   = false");
+ 	}
+ 
  	/*
  	 * Start serializable transaction to dump consistent data.
***************
*** 833,836 ****
--- 846,850 ----
  	printf(_("  -U, --username=NAME      connect as specified database user\n"));
  	printf(_("  -W, --password           force password prompt (should happen automatically)\n"));
+ 	printf(_("  --no-stats               disable statistics collection (superuser only)\n"));
  
  	printf(_("\nIf no database name is supplied, then the PGDATABASE environment\n"
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to