Re: [PATCHES] pg_dumpall bug in PG 8.0b3 Win32 port

2004-10-06 Thread Luiz K. Matsumura

Andrew Dunstan wrote:

Luiz K. Matsumura wrote:
Hi,
I  tried to use pg_dumpall in Win32 and receive a error message like 
this:

pg_dump.exe: [archiver (db)] connection to database test failed:
FATAL:  user 'postgres' does not exist
Well, the word 'postgres' is  the word is between simple quotations
marks and later between double quotations marks.
Then, I assume that the error must be in string that pg_dumpall mounts
to execute pg_dump
I modified pg_dumpall.c lines between  160 and 270  to add a #ifndef
WIN32... #endif clause to pgdumpopts to store
the parameters with double quotations intead simple quotation marks in
case of WIN32 ports
But, I don't have how to test it.
Please, somebody can test and fix the pg_dumpall.c of oficial source ?
Thanks in advance
Luiz

Please provide your patch as a context diff, not as the whole file, so 
we can see what is changed.

cheers
andrew
---(end of broadcast)---
TIP 8: explain analyze is your friend
Ops, excuse-me. I'm a novice.


*** pg_dumpall.cTue Oct  5 18:53:27 2004
--- pg_dumpall.c.oriTue Oct  5 21:59:42 2004
***
*** 180,195 
  
case 'h':
pghost = optarg;
- #ifndef WIN32
appendPQExpBuffer(pgdumpopts,  -h '%s', pghost);
- #else
- appendPQExpBuffer(pgdumpopts,  -h \%s\, pghost);
- #endif
- 
break;
  
- 
- 
case 'i':
case 'o':
appendPQExpBuffer(pgdumpopts,  -%c, c);
--- 180,188 
***
*** 201,211 
  
case 'p':
pgport = optarg;
- #ifndef WIN32
appendPQExpBuffer(pgdumpopts,  -p '%s', pgport);
- #else
- appendPQExpBuffer(pgdumpopts,  -p \%s\, pgport);
- #endif
break;
  
case 's':
--- 194,200 
***
*** 214,233 
break;
  
case 'S':
- #ifndef WIN32
appendPQExpBuffer(pgdumpopts,  -S '%s', optarg);
- #else
- appendPQExpBuffer(pgdumpopts,  -S \%s\, optarg);
- #endif
break;
  
case 'U':
pguser = optarg;
- #ifndef WIN32
appendPQExpBuffer(pgdumpopts,  -U '%s', pguser);
- #else
- appendPQExpBuffer(pgdumpopts,  -U \%s\, pguser);
- #endif
break;
  
case 'v':
--- 203,214 



---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PATCHES] pg_dumpall bug in PG 8.0b3 Win32 port

2004-10-06 Thread Tom Lane
Luiz K. Matsumura [EMAIL PROTECTED] writes:
 I modified pg_dumpall.c lines between  160 and 270  to add a #ifndef
 WIN32... #endif clause to pgdumpopts to store
 the parameters with double quotations intead simple quotation marks in
 case of WIN32 ports

This seems unnecessarily ugly.  Why not just go over to double quotes?

regards, tom lane

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PATCHES] pg_dumpall bug in PG 8.0b3 Win32 port

2004-10-06 Thread Bruce Momjian

Patch applied.  Thanks.

---


Luiz K. Matsumura wrote:
 
 
 Andrew Dunstan wrote:
 
 
 
  Luiz K. Matsumura wrote:
 
  Hi,
 
  I  tried to use pg_dumpall in Win32 and receive a error message like 
  this:
 
  pg_dump.exe: [archiver (db)] connection to database test failed:
  FATAL:  user 'postgres' does not exist
 
  Well, the word 'postgres' is  the word is between simple quotations
  marks and later between double quotations marks.
  Then, I assume that the error must be in string that pg_dumpall mounts
  to execute pg_dump
 
  I modified pg_dumpall.c lines between  160 and 270  to add a #ifndef
  WIN32... #endif clause to pgdumpopts to store
  the parameters with double quotations intead simple quotation marks in
  case of WIN32 ports
  But, I don't have how to test it.
  Please, somebody can test and fix the pg_dumpall.c of oficial source ?
 
  Thanks in advance
 
  Luiz
 
 
 
 
  Please provide your patch as a context diff, not as the whole file, so 
  we can see what is changed.
 
  cheers
 
  andrew
 
  ---(end of broadcast)---
  TIP 8: explain analyze is your friend
 
 Ops, excuse-me. I'm a novice.
 
 
 
 

 *** pg_dumpall.c  Tue Oct  5 18:53:27 2004
 --- pg_dumpall.c.ori  Tue Oct  5 21:59:42 2004
 ***
 *** 180,195 
   
   case 'h':
   pghost = optarg;
 - #ifndef WIN32
   appendPQExpBuffer(pgdumpopts,  -h '%s', pghost);
 - #else
 - appendPQExpBuffer(pgdumpopts,  -h \%s\, 
 pghost);
 - #endif
 - 
   break;
   
 - 
 - 
   case 'i':
   case 'o':
   appendPQExpBuffer(pgdumpopts,  -%c, c);
 --- 180,188 
 ***
 *** 201,211 
   
   case 'p':
   pgport = optarg;
 - #ifndef WIN32
   appendPQExpBuffer(pgdumpopts,  -p '%s', pgport);
 - #else
 - appendPQExpBuffer(pgdumpopts,  -p \%s\, 
 pgport);
 - #endif
   break;
   
   case 's':
 --- 194,200 
 ***
 *** 214,233 
   break;
   
   case 'S':
 - #ifndef WIN32
   appendPQExpBuffer(pgdumpopts,  -S '%s', optarg);
 - #else
 - appendPQExpBuffer(pgdumpopts,  -S \%s\, 
 optarg);
 - #endif
   break;
   
   case 'U':
   pguser = optarg;
 - #ifndef WIN32
   appendPQExpBuffer(pgdumpopts,  -U '%s', pguser);
 - #else
 - appendPQExpBuffer(pgdumpopts,  -U \%s\, 
 pguser);
 - #endif
   break;
   
   case 'v':
 --- 203,214 
 
 

 
 ---(end of broadcast)---
 TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


Re: [PATCHES] pg_dumpall bug in PG 8.0b3 Win32 port

2004-10-06 Thread Bruce Momjian
Andrew Dunstan wrote:
 
 
 Bruce Momjian wrote:
 
 Tom Lane wrote:
   
 
 Luiz K. Matsumura [EMAIL PROTECTED] writes:
 
 
 I modified pg_dumpall.c lines between  160 and 270  to add a #ifndef
 WIN32... #endif clause to pgdumpopts to store
 the parameters with double quotations intead simple quotation marks in
 case of WIN32 ports
   
 
 This seems unnecessarily ugly.  Why not just go over to double quotes?
 
 
 
 The patch was actually posted backward so maybe it wasn't clear but the
 change is to use double quotes instead of single quotes for Win32
 arguments just like we do in other cases in pg_dumpall.c.
 
 Single quotes do not behave the same as single quotes in the WIn32
 CMD.EXES processor.  For example, DIR  and DIR '' produce different
 results.
   
 
 
 Yes, but wasn't Tom's point that we could use double quotes on Unix too? 
 That makes sense to me unless we expect some horrible interpolation effects.

Oh, OK.  Well, if we use double-quotes we don't allow double-quotes in
the input, as well adding handling of dollar signs and other things. 
Single quotes are more robust under Unix and I don't want to risk
changing that.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [PATCHES] pg_dumpall bug in PG 8.0b3 Win32 port

2004-10-05 Thread Andrew Dunstan

Luiz K. Matsumura wrote:
Hi,
I  tried to use pg_dumpall in Win32 and receive a error message like 
this:

pg_dump.exe: [archiver (db)] connection to database test failed:
FATAL:  user 'postgres' does not exist
Well, the word 'postgres' is  the word is between simple quotations
marks and later between double quotations marks.
Then, I assume that the error must be in string that pg_dumpall mounts
to execute pg_dump
I modified pg_dumpall.c lines between  160 and 270  to add a #ifndef
WIN32... #endif clause to pgdumpopts to store
the parameters with double quotations intead simple quotation marks in
case of WIN32 ports
But, I don't have how to test it.
Please, somebody can test and fix the pg_dumpall.c of oficial source ?
Thanks in advance
Luiz

Please provide your patch as a context diff, not as the whole file, so 
we can see what is changed.

cheers
andrew
---(end of broadcast)---
TIP 8: explain analyze is your friend