Re: output file name - was pg_restore / psql

Andrew Dunstan <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.win32
Message-ID <[email protected]>
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
>  
>

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [email protected])
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.