pg_restore to log file

Started by akp geekalmost 16 years ago7 messagesgeneral
Jump to latest
#1akp geek
akpgeek@gmail.com

Hi All -

Is there a way to direct the message generated during
pg_restore to a log file?

Regards

#2Thom Brown
thombrown@gmail.com
In reply to: akp geek (#1)
Re: pg_restore to log file

On 18 May 2010 17:03, akp geek <akpgeek@gmail.com> wrote:

Hi All -
                Is there a way to direct the message generated during
pg_restore to a log file?
Regards

I think you can use "-f outputfile".

Regards

Thom

#3akp geek
akpgeek@gmail.com
In reply to: Thom Brown (#2)
Re: pg_restore to log file

pg_restore -h 10.xx.xx.xxx -d dbName -n schemaName -v -U postgres
testDB_20100414.txt -f outputifile

I got the following error "pg_restore: options -d/--dbname and -f/--file
cannot be used together"

Regards

On Tue, May 18, 2010 at 12:07 PM, Thom Brown <thombrown@gmail.com> wrote:

Show quoted text

On 18 May 2010 17:03, akp geek <akpgeek@gmail.com> wrote:

Hi All -
Is there a way to direct the message generated during
pg_restore to a log file?
Regards

I think you can use "-f outputfile".

Regards

Thom

#4Thom Brown
thombrown@gmail.com
In reply to: akp geek (#3)
Re: pg_restore to log file

On 18 May 2010 17:11, akp geek <akpgeek@gmail.com> wrote:

pg_restore -h 10.xx.xx.xxx  -d dbName  -n schemaName -v -U postgres
 testDB_20100414.txt    -f outputifile

I got the following error "pg_restore: options -d/--dbname and -f/--file
cannot be used together"

Regards

That's odd. I can't see why those settings should conflict, although
I notice you haven't specified your input file as the last parameter.
It shouldn't appear before the other arguments.

Anyone else know?

Thom

#5Scott Mead
scott.lists@enterprisedb.com
In reply to: akp geek (#3)
Re: pg_restore to log file

On Tue, May 18, 2010 at 12:11 PM, akp geek <akpgeek@gmail.com> wrote:

pg_restore -h 10.xx.xx.xxx -d dbName -n schemaName -v -U postgres
testDB_20100414.txt -f outputifile

I got the following error "pg_restore: options -d/--dbname and -f/--file
cannot be used together"

I think you would either capture stdout or stderr (I'm honestly not sure
which is required)

pg_restore -all options >output.txt 2>&1

--Scott

Show quoted text

Regards

On Tue, May 18, 2010 at 12:07 PM, Thom Brown <thombrown@gmail.com> wrote:

On 18 May 2010 17:03, akp geek <akpgeek@gmail.com> wrote:

Hi All -
Is there a way to direct the message generated during
pg_restore to a log file?
Regards

I think you can use "-f outputfile".

Regards

Thom

#6Scott Mead
scott.lists@enterprisedb.com
In reply to: Thom Brown (#4)
Re: pg_restore to log file

On Tue, May 18, 2010 at 12:15 PM, Thom Brown <thombrown@gmail.com> wrote:

On 18 May 2010 17:11, akp geek <akpgeek@gmail.com> wrote:

pg_restore -h 10.xx.xx.xxx -d dbName -n schemaName -v -U postgres
testDB_20100414.txt -f outputifile

I got the following error "pg_restore: options -d/--dbname and -f/--file
cannot be used together"

Regards

That's odd. I can't see why those settings should conflict, although
I notice you haven't specified your input file as the last parameter.
It shouldn't appear before the other arguments.

Yeah, the output file isn't for messages, it's for the data. You can
restore a compressed dump to two places, either a text file (-f) or a
database (-d).

--Scott

Show quoted text

Anyone else know?

Thom

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#7akp geek
akpgeek@gmail.com
In reply to: Scott Mead (#5)
Re: pg_restore to log file

Thanks a lot

pg_restore -all options >output.txt 2>&1 worked

Regards

On Tue, May 18, 2010 at 12:15 PM, Scott Mead
<scott.lists@enterprisedb.com>wrote:

Show quoted text

On Tue, May 18, 2010 at 12:11 PM, akp geek <akpgeek@gmail.com> wrote:

pg_restore -h 10.xx.xx.xxx -d dbName -n schemaName -v -U postgres
testDB_20100414.txt -f outputifile

I got the following error "pg_restore: options -d/--dbname and -f/--file
cannot be used together"

I think you would either capture stdout or stderr (I'm honestly not sure
which is required)

pg_restore -all options >output.txt 2>&1

--Scott

Regards

On Tue, May 18, 2010 at 12:07 PM, Thom Brown <thombrown@gmail.com> wrote:

On 18 May 2010 17:03, akp geek <akpgeek@gmail.com> wrote:

Hi All -
Is there a way to direct the message generated during
pg_restore to a log file?
Regards

I think you can use "-f outputfile".

Regards

Thom