Skip site navigation (1) Skip section navigation (2)

Re: output file name - was pg_restore / psql

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Harald Armin Massa <ghum(at)gmx(dot)net>
Cc: pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: output file name - was pg_restore / psql
Date: 2004-10-03 21:39:21
Message-ID: 41607189.3070609@dunslane.net (view raw or flat)
Thread:
Lists: 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
>  
>

In response to

Responses

pgsql-hackers-win32 by date

Next:From: Harald Armin MassaDate: 2004-10-03 22:44:48
Subject: Re: output file name - was pg_restore / psql
Previous:From: Harald Armin MassaDate: 2004-10-03 18:27:17
Subject: output file name - was pg_restore / psql -f massive problems with

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group