Re: pg_backup symlink?

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: pg_backup symlink?
Date: 2000-07-12 01:50:51
Message-ID: 3.0.5.32.20000712115051.009b8e00@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

At 02:23 12/07/00 +0200, Peter Eisentraut wrote:
>
>IMHO, it's a bad strategy to add symlinks as shortcuts to certain
>options. Where would that ever lead?

I suppose the glib answer is "to a more convenient and easy to use tool" 8-}.

>There are tons of options settings I
>use "most often" in various programs, but for that you can use shells
>aliases or scripts, or the program provides an environment variable for
>default options.

In this case I view pg_dump's default behaviour as an anachronism caused by
compatibility issues, not a feature. Dumping to text without blobs is like
asking ls to only list files whose names are in lower case.

>The default behaviour of pg_dump (or pg_backup or whatever) should be to
>write plain text to stdout. If you want to write format "foo", use the
>-Ffoo option. If you want to dump blobs, use the --blob option. That makes
>sense.

With a symlink, that's what you get. You will still be able to add '-Ffoo'
to pg_dump (or -Fp to pg_backup)

>You're really trying to force certain usage patterns by labeling one
>invocation "backup" and another "dump". I can foresee the user problems:
>"No, you have to use pg_dump for that, not pg_backup!"

The actualy answer to the question is: "either use 'pg_dump -Fc --blob', or
just use pg_backup, whichever you find easiest to remember".

This works both ways: "I used pg_dump to backup my db, but it doesn't
contain the blobs" - I've certainly seen that message a few times. Both
issues are solved by documentation.

Until a scipt file can import blob data directly from stdin, a text file
can not be used to backup blobs, so the default behaviour of pg_dump is
unsuitable for backups.

>We're still
>battling that sympton in the createdb vs CREATE DATABASE case.

My guess is these issues were also created by legacy code.

>What's wrong with just having pg_dump, period? After all pg_dump isn't
>something you use like `ls' or `cat' where every extra keystroke is a
>pain.

No, but for less commonly used utilities, it's probably more important to
have a simple way invoke a basic, important, function.

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.C.N. 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-07-12 02:01:25 Re: Stored Procedure warnings
Previous Message Cesar A. K. Grossmann 2000-07-12 01:46:06 Complex checking with SQL

Browse pgsql-hackers by date

  From Date Subject
Next Message Alfred Perlstein 2000-07-12 01:53:18 Connection pooling.
Previous Message Tom Lane 2000-07-12 01:28:31 Re: Insert..returning (was Re: Re: postgres TODO)