Re: How to pipe the psql copy command to Unix 'Date' command - Mailing list pgsql-general

From Alan Hodgson
Subject Re: How to pipe the psql copy command to Unix 'Date' command
Date
Msg-id 200903021612.05199@hal.medialogik.com
Whole thread Raw
In response to Re: How to pipe the psql copy command to Unix 'Date' command  (John R Pierce <pierce@hogranch.com>)
List pgsql-general
On Monday 02 March 2009, John R Pierce <pierce@hogranch.com> wrote:
> SHARMILA JOTHIRAJAH wrote:
> > Is it possible to sent this 'time' output to a file...
> > If I try
> > time cmd1 someargs1 | cmd2 someargs2 > output.log
> >
> > it doesn't sent the "time" to the file...
>
> time (cmd1 someargs1 | cmd2 someargs2) > output.log
>
>
> the way you had it, it was only timing cmd1.  with the ( ), its spawning
> a subshell which should run both commands piped...

time also reports on stderr, not stdout.

time (cmd1 someargs1 | cmd2 someargs2) > output.log 2>&1

--
Even a sixth-grader can figure out that you can’t borrow money to pay off
your debt

pgsql-general by date:

Previous
From: Greg Smith
Date:
Subject: Re: Detemine database size on Postgres 8.0
Next
From: Alan Hodgson
Date:
Subject: Re: php4 and postgresql 8.3