Thread: pg_restore options issues

pg_restore options issues

From
Peter Eisentraut
Date:
pg_restore has some options that are supposed to allow restoring some or
all indexes/tables/triggers/etc.  For example

pg_restore --table

restores all tables and

pg_restore --table=my_table

restores only the named table.  The equivalent short option is -t but it
does not allow restoring all tables, since it requires an argument.  I
suggest that an argument of '*' also means to restore all tables.

Also, if you just call pg_restore without arguments it hangs waiting for
input from stdin.  This is a bit confusing.  I suggest that stdin is used
if and only if the file name argument is '-'.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



Re: pg_restore options issues

From
Philip Warner
Date:
At 22:05 6/01/01 +0100, Peter Eisentraut wrote:
>
>restores only the named table.  The equivalent short option is -t but it
>does not allow restoring all tables, since it requires an argument.  I
>suggest that an argument of '*' also means to restore all tables.

Sounds fine. 


>Also, if you just call pg_restore without arguments it hangs waiting for
>input from stdin.  This is a bit confusing.  I suggest that stdin is used
>if and only if the file name argument is '-'.

Also sounds reasonable.


I'm working on pg_dump at the moment, so if there is anything else, let me
know.


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 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   |/


Re: pg_restore options issues

From
"Oliver Elphick"
Date:
Peter Eisentraut wrote: >pg_restore has some options that are supposed to allow restoring some or >all
indexes/tables/triggers/etc. For example > >pg_restore --table > >restores all tables and > >pg_restore
--table=my_table> >restores only the named table.  The equivalent short option is -t but it >does not allow restoring
alltables, since it requires an argument.  I >suggest that an argument of '*' also means to restore all tables.
 

I don't like that; it will need to be escaped with \ or the shell will
substitute the contents of the current directory for the *.

Why not use `-t all' or `-A'?

You should also change the help text a bit:
 -t [table], --table[=table]      dump for this table only

gives no hint that omitting `=table' will restore all tables.

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
========================================   "Blessed are the pure in heart, for they shall see      God."
   Matthew 5:8 
 




Re: pg_restore options issues

From
Peter Eisentraut
Date:
Oliver Elphick writes:

> I don't like that; it will need to be escaped with \ or the shell will
> substitute the contents of the current directory for the *.
>
> Why not use `-t all'

Because there might be a table called "all".  (Okay, there could be a
table called "*", but really...)

> or `-A'?

We'd need an option letter for tables, triggers, indexes, functions, etc.

> You should also change the help text a bit:
>
>   -t [table], --table[=table]      dump for this table only
>
> gives no hint that omitting `=table' will restore all tables.

Okay, when we decide how to handle it.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/