public inbox for [email protected]  
help / color / mirror / Atom feed
suggestion for improving TMPDIR and "--format" docs for pg_dump
11+ messages / 5 participants
[nested] [flat]

* suggestion for improving TMPDIR and "--format" docs for pg_dump
@ 2007-03-09 02:30 Mark Stosberg <[email protected]>
  2007-03-09 10:21 ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Peter Eisentraut <[email protected]>
  2007-03-19 17:43 ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
  0 siblings, 2 replies; 11+ messages in thread

From: Mark Stosberg @ 2007-03-09 02:30 UTC (permalink / raw)
  To: pgsql-docs

A suggested addition to the pg_dump docs:

This would be an extension to the documentation for the "tar" format:

The tar format needs some space to create temporary files. By default
"/tmp" is used. On systems with small "/tmp" partitions, set the
"TMPDIR" environment variable to a location with more space, such as
"/usr/tmp".

Also, I would like it if the pg_dump docs more assertively recommended
one of the "tar" or "custom" formats. They seem very similiar.

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. )

    Mark



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: suggestion for improving TMPDIR and "--format" docs for pg_dump
  2007-03-09 02:30 suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
@ 2007-03-09 10:21 ` Peter Eisentraut <[email protected]>
  2007-03-09 14:31   ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
  1 sibling, 1 reply; 11+ messages in thread

From: Peter Eisentraut @ 2007-03-09 10:21 UTC (permalink / raw)
  To: pgsql-docs; +Cc: Mark Stosberg <[email protected]>

Am Freitag, 9. März 2007 03:30 schrieb Mark Stosberg:
> The tar format needs some space to create temporary files. By default
> "/tmp" is used. On systems with small "/tmp" partitions, set the
> "TMPDIR" environment variable to a location with more space, such as
> "/usr/tmp".

That is really standard operating system behavior.  We don't need to duplicate 
that information.

> It woud also be nice to document that the full names "custom" and "tar" are
> supported. Longer names can be nice for clarity.

They are.  You must be looking at an older version.

> ( Unfortunately, wrong formats like "txx" also work instead of throwing
> an error. )

Send a patch.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: suggestion for improving TMPDIR and "--format" docs for pg_dump
  2007-03-09 02:30 suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
  2007-03-09 10:21 ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Peter Eisentraut <[email protected]>
@ 2007-03-09 14:31   ` Mark Stosberg <[email protected]>
  0 siblings, 0 replies; 11+ messages in thread

From: Mark Stosberg @ 2007-03-09 14:31 UTC (permalink / raw)
  To: pgsql-docs

Peter Eisentraut wrote:
> Am Freitag, 9. März 2007 03:30 schrieb Mark Stosberg:
>> The tar format needs some space to create temporary files. By default
>> "/tmp" is used. On systems with small "/tmp" partitions, set the
>> "TMPDIR" environment variable to a location with more space, such as
>> "/usr/tmp".
> 
> That is really standard operating system behavior.  We don't need to duplicate 
> that information.

So is

 ./configure
 make
 make install

These are all external, standard programs, but they are common and
useful to document with applications. I think a small amount of
redundancy is documentation is a good thing.

When I wanted to use a different tmp dir, I searched the PostgreSQL docs
for how to do that, because I was using a PostgreSQL tool. I had no why
of knowing whether PostgreSQL was even using standard conventions of
tmpdir handling, of if it did it's own thing. Also, after several years
of being professional involved with Unix system maintenance, I was not
aware that this was a standard feature. Surely then, less advanced users
would benefit from the documentation.

>> It woud also be nice to document that the full names "custom" and "tar" are
>> supported. Longer names can be nice for clarity.
> 
> They are.  You must be looking at an older version.

You are correct. Sorry about that.

>> ( Unfortunately, wrong formats like "txx" also work instead of throwing
>> an error. )
> 
> Send a patch.

I appreciate the sentiment, by my C skills are weak.

       Mark



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: suggestion for improving TMPDIR and "--format" docs for pg_dump
  2007-03-09 02:30 suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
@ 2007-03-19 17:43 ` Bruce Momjian <[email protected]>
  2007-03-19 17:47   ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
  1 sibling, 1 reply; 11+ messages in thread

From: Bruce Momjian @ 2007-03-19 17:43 UTC (permalink / raw)
  To: Mark Stosberg <[email protected]>; +Cc: pgsql-docs

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 Momjian  <[email protected]>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

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



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: suggestion for improving TMPDIR and "--format" docs for pg_dump
  2007-03-09 02:30 suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
  2007-03-19 17:43 ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
@ 2007-03-19 17:47   ` Mark Stosberg <[email protected]>
  2007-03-22 19:43     ` Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
  0 siblings, 1 reply; 11+ messages in thread

From: Mark Stosberg @ 2007-03-19 17:47 UTC (permalink / raw)
  To: ; +Cc: pgsql-docs

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

     Mark



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump
  2007-03-09 02:30 suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
  2007-03-19 17:43 ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
  2007-03-19 17:47   ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
@ 2007-03-22 19:43     ` Bruce Momjian <[email protected]>
  2007-03-22 20:17       ` Re: Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump Tom Lane <[email protected]>
  2007-03-22 20:41       ` Re: Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump Dave Page <[email protected]>
  0 siblings, 2 replies; 11+ messages in thread

From: Bruce Momjian @ 2007-03-22 19:43 UTC (permalink / raw)
  To: Mark Stosberg <[email protected]>; +Cc: PostgreSQL-patches <[email protected]>

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. +


Attachments:

  [text/x-diff] /rtmp/diff (2.3K, 2-%2Frtmp%2Fdiff)
  download | inline diff:
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 -0000	1.461
--- src/bin/pg_dump/pg_dump.c	22 Mar 2007 18:39:53 -0000
***************
*** 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)


^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump
  2007-03-09 02:30 suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
  2007-03-19 17:43 ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
  2007-03-19 17:47   ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
  2007-03-22 19:43     ` Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
@ 2007-03-22 20:17       ` Tom Lane <[email protected]>
  2007-03-22 20:18         ` Re: Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
  1 sibling, 1 reply; 11+ messages in thread

From: Tom Lane @ 2007-03-22 20:17 UTC (permalink / raw)
  To: Bruce Momjian <[email protected]>; +Cc: Mark Stosberg <[email protected]>; PostgreSQL-patches <[email protected]>

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



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump
  2007-03-09 02:30 suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
  2007-03-19 17:43 ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
  2007-03-19 17:47   ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
  2007-03-22 19:43     ` Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
  2007-03-22 20:17       ` Re: Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump Tom Lane <[email protected]>
@ 2007-03-22 20:18         ` Bruce Momjian <[email protected]>
  0 siblings, 0 replies; 11+ messages in thread

From: Bruce Momjian @ 2007-03-22 20:18 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; +Cc: Mark Stosberg <[email protected]>; PostgreSQL-patches <[email protected]>

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. +



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump
  2007-03-09 02:30 suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
  2007-03-19 17:43 ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
  2007-03-19 17:47   ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
  2007-03-22 19:43     ` Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
@ 2007-03-22 20:41       ` Dave Page <[email protected]>
  2007-03-22 20:44         ` Re: Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
  1 sibling, 1 reply; 11+ messages in thread

From: Dave Page @ 2007-03-22 20:41 UTC (permalink / raw)
  To: Bruce Momjian <[email protected]>; +Cc: Mark Stosberg <[email protected]>; PostgreSQL-patches <[email protected]>

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.



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump
  2007-03-09 02:30 suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
  2007-03-19 17:43 ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
  2007-03-19 17:47   ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
  2007-03-22 19:43     ` Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
  2007-03-22 20:41       ` Re: Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump Dave Page <[email protected]>
@ 2007-03-22 20:44         ` Bruce Momjian <[email protected]>
  2007-03-22 20:47           ` Re: Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump Dave Page <[email protected]>
  0 siblings, 1 reply; 11+ messages in thread

From: Bruce Momjian @ 2007-03-22 20:44 UTC (permalink / raw)
  To: Dave Page <[email protected]>; +Cc: Mark Stosberg <[email protected]>; PostgreSQL-patches <[email protected]>

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. +



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump
  2007-03-09 02:30 suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
  2007-03-19 17:43 ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
  2007-03-19 17:47   ` Re: suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
  2007-03-22 19:43     ` Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
  2007-03-22 20:41       ` Re: Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump Dave Page <[email protected]>
  2007-03-22 20:44         ` Re: Re: [DOCS] suggestion for improving TMPDIR and "--format" docs for pg_dump Bruce Momjian <[email protected]>
@ 2007-03-22 20:47           ` Dave Page <[email protected]>
  0 siblings, 0 replies; 11+ messages in thread

From: Dave Page @ 2007-03-22 20:47 UTC (permalink / raw)
  To: Bruce Momjian <[email protected]>; +Cc: Mark Stosberg <[email protected]>; PostgreSQL-patches <[email protected]>

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





^ permalink  raw  reply  [nested|flat] 11+ messages in thread


end of thread, other threads:[~2007-03-22 20:47 UTC | newest]

Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-03-09 02:30 suggestion for improving TMPDIR and "--format" docs for pg_dump Mark Stosberg <[email protected]>
2007-03-09 10:21 ` Peter Eisentraut <[email protected]>
2007-03-09 14:31   ` Mark Stosberg <[email protected]>
2007-03-19 17:43 ` Bruce Momjian <[email protected]>
2007-03-19 17:47   ` Mark Stosberg <[email protected]>
2007-03-22 19:43     ` Bruce Momjian <[email protected]>
2007-03-22 20:17       ` Tom Lane <[email protected]>
2007-03-22 20:18         ` Bruce Momjian <[email protected]>
2007-03-22 20:41       ` Dave Page <[email protected]>
2007-03-22 20:44         ` Bruce Momjian <[email protected]>
2007-03-22 20:47           ` Dave Page <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox