Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: pg_autovacuum log paths can't contain spaces


  • From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
  • To: "Barry Lind" <blind(at)xythos(dot)com>, <pgsql-hackers-win32(at)postgresql(dot)org>
  • Cc: "PostgreSQL-patches" <pgsql-patches(at)postgresql(dot)org>
  • Subject: Re: pg_autovacuum log paths can't contain spaces
  • Date: Tue, 21 Sep 2004 10:14:06 +0100
  • Message-id: <E7F85A1B5FF8D44C8A1AF6885BC9A0E43065AA(at)ratbert(dot)vale-housing(dot)co(dot)uk>

 

> -----Original Message-----
> From: pgsql-hackers-win32-owner(at)postgresql(dot)org 
> [mailto:pgsql-hackers-win32-owner(at)postgresql(dot)org] On Behalf 
> Of Barry Lind
> Sent: 21 September 2004 00:46
> To: pgsql-hackers-win32(at)postgresql(dot)org
> Subject: [pgsql-hackers-win32] pg_autovacuum log paths can't 
> contain spaces
> 
> I just installed the beta2 Dev 3 version of the installer.  
> When I went to go tryout pg_autovacuum I noticed two problem:
> 
> 1) -P isn't working correctly.  -P is being interpreted as -p 
> in the service code and it tries to use the password (-P) 
> that I passed in as the port (-p).  I seem to recall a 
> previous email about this and think this is already fixed in CVS.

Yup, it has been.

> 2) When I specify a path that contains spaces to the -L 
> switch it doesn't work correctly.

The patch below should rectify this.

Regards, Dave.


Index: pg_autovacuum.c
===================================================================
RCS file:
/projects/cvsroot/pgsql-server/contrib/pg_autovacuum/pg_autovacuum.c,v
retrieving revision 1.21
diff -u -r1.21 pg_autovacuum.c
--- pg_autovacuum.c	14 Sep 2004 04:06:20 -0000	1.21
+++ pg_autovacuum.c	21 Sep 2004 09:10:22 -0000
@@ -1217,7 +1217,13 @@
 	if (args->password)
 		sprintf(szCommand, "%s -P %s", szCommand,
args->password);
 	if (args->logfile)
-		sprintf(szCommand, "%s -L %s", szCommand,
args->logfile);
+	{
+		if (strstr(args->logfile, " "))
+			sprintf(szCommand, "%s -L \"%s\"", szCommand,
args->logfile);
+		else
+			sprintf(szCommand, "%s -L %s", szCommand,
args->logfile);
+	}
+	
 	if (args->sleep_base_value != (int) SLEEPBASEVALUE)
 		sprintf(szCommand, "%s -s %i", szCommand,
args->sleep_base_value);
 	if (args->sleep_scaling_factor != (float) SLEEPSCALINGFACTOR)



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group