Re: [PATCHES] pg_restore -F bug

2005-04-30 Thread Neil Conway
Tom Lane wrote:
Certainly --- particularly if the error makes it dump core, as seems
likely (haven't tried it).
Ok, backpatched to stable branches back to 7.2
-Neil
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faq


[PATCHES] pg_restore -F bug

2005-04-29 Thread Neil Conway
This patch fixes a bug in the error message emitted by pg_restore on an 
incorrect -F argument: write_msg() expects its first parameter to be a 
module name, not the format string. Patch applied to HEAD. Is this 
worth backporting?

BTW, is there a reason that pg_restore seems to accept 'f', 't', or 'c' 
parameters to this argument, but the documentation only documents 't' 
and 'c'?

-Neil
Index: src/bin/pg_dump/pg_restore.c
===
RCS file: /var/lib/cvs/pgsql/src/bin/pg_dump/pg_restore.c,v
retrieving revision 1.69
diff -c -r1.69 pg_restore.c
*** src/bin/pg_dump/pg_restore.c	22 Feb 2005 04:39:38 -	1.69
--- src/bin/pg_dump/pg_restore.c	29 Apr 2005 06:46:34 -
***
*** 313,319 
  break;
  
  			default:
! write_msg(unrecognized archive format '%s'; please specify 't' or 'c'\n,
  		  opts-formatName);
  exit(1);
  		}
--- 313,319 
  break;
  
  			default:
! write_msg(NULL, unrecognized archive format '%s'; please specify 't' or 'c'\n,
  		  opts-formatName);
  exit(1);
  		}

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PATCHES] pg_restore -F bug

2005-04-29 Thread Bruce Momjian
Neil Conway wrote:
 This patch fixes a bug in the error message emitted by pg_restore on an 
 incorrect -F argument: write_msg() expects its first parameter to be a 
 module name, not the format string. Patch applied to HEAD. Is this 
 worth backporting?
 
 BTW, is there a reason that pg_restore seems to accept 'f', 't', or 'c' 
 parameters to this argument, but the documentation only documents 't' 
 and 'c'?

I didn't think pg_restore could use a text file, and I think it emits an
error if you try.  Maybe they accept the flag so they can throw a
meaningful error later.

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  pgman@candle.pha.pa.us   |  (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_restore -F bug

2005-04-29 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] writes:
 This patch fixes a bug in the error message emitted by pg_restore on an 
 incorrect -F argument: write_msg() expects its first parameter to be a 
 module name, not the format string. Patch applied to HEAD. Is this 
 worth backporting?

Certainly --- particularly if the error makes it dump core, as seems
likely (haven't tried it).

 BTW, is there a reason that pg_restore seems to accept 'f', 't', or 'c' 
 parameters to this argument, but the documentation only documents 't' 
 and 'c'?

I think the 'f' option is only intended for debugging purposes ...
Philip would know ...

regards, tom lane

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