Re: output file name - was pg_restore / psql - Mailing list pgsql-hackers-win32

From Andrew Dunstan
Subject Re: output file name - was pg_restore / psql
Date
Msg-id 41607189.3070609@dunslane.net
Whole thread Raw
In response to output file name - was pg_restore / psql -f massive problems with  (Harald Armin Massa <ghum@gmx.net>)
Responses Re: output file name - was pg_restore / psql  (Harald Armin Massa <ghum@gmx.net>)
List pgsql-hackers-win32
Unless you restore to a database using -d, pg_restore gives you back the
SQL  (or a list if you use -l). -f specifies where this should go
instead of to stdout.

Or, as the man page clearly says:

       pg_restore  can  operate in two modes: If a database name is
specified,
       the archive is restored directly into the database. Otherwise, a
script
       containing  the  SQL commands necessary to rebuild the database
is cre-
       ated (and written to a file or standard output), similar  to
the  ones
       created  by the pg_dump plain text format.

does that make it clearer? (Reading the man pages is a Good Thing (tm). )

cheers

andrew

Harald Armin Massa wrote:

> Andrey,
>
> thank you very much! Both informations are correct.
>
> It is indeed possible to restore with using the -F c option on
> pg_dump, and I replaces psql.exe with the one from beta3, and
> everything worked correct.
>
> So it is positive that this information is now on the newer dates in
> the psql-mailinglists to google it up - I threw my hopes away after
> reading "pg_restore is known not to work" within win32-hackers .)))
>
> ###########################################################
>
> Usage:
>  pg_restore [OPTION]... [FILE]
>
> General options:
>  -d, --dbname=NAME        output database name
>  -f, --file=FILENAME      output file name
>
> I struggled some syntax-times with "output file name". What is a
> "output file" supposed to be in connection with "pg_Restore"?
>
> Harald
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 8: explain analyze is your friend
>
>

pgsql-hackers-win32 by date:

Previous
From: Harald Armin Massa
Date:
Subject: output file name - was pg_restore / psql -f massive problems with
Next
From: Harald Armin Massa
Date:
Subject: Re: output file name - was pg_restore / psql