[PATCHES] Re: [DOCS] suggestion for improving TMPDIR and --format docs for pg_dump

2007-03-22 Thread Bruce Momjian
Mark Stosberg wrote:
 Bruce Momjian wrote:
  Mark Stosberg wrote:
  It woud also be nice to document that the full names custom and tar are
  supported. Longer names can be nice for clarity.
 
  ( Unfortunately, wrong formats like txx also work instead of throwing
  an error. )
  
  I don't see that with current CVS:
  
  $ pg_dump --format=x test
  pg_dump: invalid output format x specified
 
 Bruce,
 
 I think the specific test case would have to start with a valid letter,
 like t, and then include invalid characters. Try this instead:
 
  pg_dump --format=tx test

Thanks for the report.  I have corrected this and the fix will be in
PostgreSQL 8.3.  Interestingly, we support non-documented option
append and file too.

Patch attached and applied.

-- 
  Bruce Momjian  [EMAIL PROTECTED]  http://momjian.us
  EnterpriseDB   http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: src/bin/pg_dump/pg_dump.c
===
RCS file: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v
retrieving revision 1.461
diff -c -c -r1.461 pg_dump.c
*** src/bin/pg_dump/pg_dump.c	19 Mar 2007 23:38:30 -	1.461
--- src/bin/pg_dump/pg_dump.c	22 Mar 2007 18:39:53 -
***
*** 476,513 
  	}
  
  	/* open the output file */
! 	switch (format[0])
  	{
! 		case 'a':
! 		case 'A':
! 			plainText = 1;
! 			g_fout = CreateArchive(filename, archNull, 0, archModeAppend);
! 			break;
! 			
! 		case 'c':
! 		case 'C':
! 			g_fout = CreateArchive(filename, archCustom, compressLevel, archModeWrite);
! 			break;
! 
! 		case 'f':
! 		case 'F':
! 			g_fout = CreateArchive(filename, archFiles, compressLevel, archModeWrite);
! 			break;
! 
! 		case 'p':
! 		case 'P':
! 			plainText = 1;
! 			g_fout = CreateArchive(filename, archNull, 0, archModeWrite);
! 			break;
! 
! 		case 't':
! 		case 'T':
! 			g_fout = CreateArchive(filename, archTar, compressLevel, archModeWrite);
! 			break;
! 
! 		default:
! 			write_msg(NULL, invalid output format \%s\ specified\n, format);
! 			exit(1);
  	}
  
  	if (g_fout == NULL)
--- 476,508 
  	}
  
  	/* open the output file */
! 	if (strcasecmp(format, a) == 0 || strcasecmp(format, append) == 0)
  	{
! 		/* not documented */
! 		plainText = 1;
! 		g_fout = CreateArchive(filename, archNull, 0, archModeAppend);
! 	}
! 	else if (strcasecmp(format, c) == 0 || strcasecmp(format, custom) == 0)
! 		g_fout = CreateArchive(filename, archCustom, compressLevel, archModeWrite);
! 	else if (strcasecmp(format, f) == 0 || strcasecmp(format, file) == 0)
! 	{
! 		/*
! 		 *	Dump files into the current directory; for demonstration only, not
! 		 *	documented.
! 		 */
! 		g_fout = CreateArchive(filename, archFiles, compressLevel, archModeWrite);
! 	}
! 	else if (strcasecmp(format, p) == 0 || strcasecmp(format, plain) == 0)
! 	{
! 		plainText = 1;
! 		g_fout = CreateArchive(filename, archNull, 0, archModeWrite);
! 	}
! 	else if (strcasecmp(format, t) == 0 || strcasecmp(format, tar) == 0)
! 		g_fout = CreateArchive(filename, archTar, compressLevel, archModeWrite);
! 	else
! 	{
! 		write_msg(NULL, invalid output format \%s\ specified\n, format);
! 		exit(1);
  	}
  
  	if (g_fout == NULL)

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [PATCHES] Re: [DOCS] suggestion for improving TMPDIR and --format docs for pg_dump

2007-03-22 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes:
 Thanks for the report.  I have corrected this and the fix will be in
 PostgreSQL 8.3.  Interestingly, we support non-documented option
 append and file too.

Surely these should all be pg_strcasecmp?

regards, tom lane

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [PATCHES] Re: [DOCS] suggestion for improving TMPDIR and --format docs for pg_dump

2007-03-22 Thread Bruce Momjian
Tom Lane wrote:
 Bruce Momjian [EMAIL PROTECTED] writes:
  Thanks for the report.  I have corrected this and the fix will be in
  PostgreSQL 8.3.  Interestingly, we support non-documented option
  append and file too.
 
 Surely these should all be pg_strcasecmp?

Yep, fixed.

-- 
  Bruce Momjian  [EMAIL PROTECTED]  http://momjian.us
  EnterpriseDB   http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [PATCHES] Re: [DOCS] suggestion for improving TMPDIR and --format docs for pg_dump

2007-03-22 Thread Dave Page
Bruce Momjian wrote:

 Thanks for the report.  I have corrected this and the fix will be in
 PostgreSQL 8.3.  Interestingly, we support non-documented option
 append and file too.

Append is undocumented as it's intended to be used by pg_dumpall, not
directly by users.


Regards, Dave.

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


Re: [PATCHES] Re: [DOCS] suggestion for improving TMPDIR and --format docs for pg_dump

2007-03-22 Thread Bruce Momjian
Dave Page wrote:
 Bruce Momjian wrote:
 
  Thanks for the report.  I have corrected this and the fix will be in
  PostgreSQL 8.3.  Interestingly, we support non-documented option
  append and file too.
 
 Append is undocumented as it's intended to be used by pg_dumpall, not
 directly by users.

Ah, OK, but there should be a clear comment somewhere about that.  I
will add it.

-- 
  Bruce Momjian  [EMAIL PROTECTED]  http://momjian.us
  EnterpriseDB   http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate


Re: [PATCHES] Re: [DOCS] suggestion for improving TMPDIR and --format docs for pg_dump

2007-03-22 Thread Dave Page
Bruce Momjian wrote:
 Dave Page wrote:
 Bruce Momjian wrote:

 Thanks for the report.  I have corrected this and the fix will be in
 PostgreSQL 8.3.  Interestingly, we support non-documented option
 append and file too.
 Append is undocumented as it's intended to be used by pg_dumpall, not
 directly by users.
 
 Ah, OK, but there should be a clear comment somewhere about that.  I
 will add it.
 

Thanks.

Regards Dave


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