How to pipe the psql copy command to Unix 'Date' command

From: SHARMILA JOTHIRAJAH <sharmi_jo(at)yahoo(dot)com>
To: General postgres mailing list <pgsql-general(at)postgresql(dot)org>
Subject: How to pipe the psql copy command to Unix 'Date' command
Date: 2009-02-19 16:37:38
Message-ID: 592933.14174.qm@web110704.mail.gq1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
I want to find the time taken by this process ...retrieving data from oracle database using java and copying that to postgres using copy.
So I need something like this

Start_Time|java testCode ...|psql -c "copy dummy from stdin with delimiter ',' null 'NULL'" test| End_time

so that the output is like this

Start_time 2009-02-19 11:30:15
End_time 2009-02-19 11:40:15

This should give me the time this process started and the time it ended. Is that possible?

Thanks
Sharmila

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mirko Pace 2009-02-19 17:07:49 Re: How to pipe the psql copy command to Unix 'Date' command
Previous Message Glyn Astill 2009-02-19 16:23:24 Re: Query palns and tug-of-war with enable_sort