From: | R Smith <4otherbusiness(at)comcast(dot)net> |
---|---|
To: | General postgres mailing list <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: How to pipe the psql copy command to Unix 'Date' command |
Date: | 2009-02-20 02:30:09 |
Message-ID: | 37FDBF6A-D2D0-472C-9012-7F10C6DA3EF2@comcast.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Feb 19, 2009, at 11:07 AM, SHARMILA JOTHIRAJAH wrote:
> Thanks all
> -Sharmila
>
>
> --- On Thu, 2/19/09, Erik Jones <ejones(at)engineyard(dot)com> wrote:
>
>> From: Erik Jones <ejones(at)engineyard(dot)com>
>> Subject: Re: [GENERAL] How to pipe the psql copy command to Unix
>> 'Date' command
>> To: sharmi_jo(at)yahoo(dot)com
>> Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "General postgres mailing list"
>> <pgsql-general(at)postgresql(dot)org>
>> Date: Thursday, February 19, 2009, 1:31 PM
>> On Feb 19, 2009, at 9:40 AM, SHARMILA JOTHIRAJAH wrote:
>>
>>> --- On Thu, 2/19/09, Tom Lane
>> <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>>
>>>> From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
>>>> Subject: Re: [GENERAL] How to pipe the psql copy
>> command to Unix 'Date' command
>>>> To: sharmi_jo(at)yahoo(dot)com
>>>> Cc: "General postgres mailing list"
>> <pgsql-general(at)postgresql(dot)org>
>>>> Date: Thursday, February 19, 2009, 12:31 PM
>>>> SHARMILA JOTHIRAJAH <sharmi_jo(at)yahoo(dot)com>
>> writes:
>>>>> 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
>>>>
>>>> time java testCode ...|psql -c "copy dummy
>> from stdin
>>>> with delimiter ',' null
>> 'NULL'" test
>>>>
>>>> Or do you really insist on doing the timestamp
>> subtraction
>>>> by hand?
>>>>
>>>>
>>> No...I would definitely prefer to get the time elapsed
>> between the start of the java program and the end of the
>> copy command... Is that possible ? If not at least the start
>> and the end time so tht i can do the calculation myself
>>
>> Tom just showed you how. Use run full piped command with
>> the unix 'time' utility.
>>
>> Erik Jones, Database Administrator
>
I've used UNIX for years and I don't know what you mean by 'use run
full piped command'.
Sure I know pipes and scripting, but ?
I would put everything needed w/ a shell script, calls to java & PG,
and set a var to unixtime at start and subtract it from the ending
unixtime.
If nothing else, I might pick up a Linux trick!
Thanks,
Ralph Smith
From | Date | Subject | |
---|---|---|---|
Next Message | Erik Jones | 2009-02-20 04:08:04 | Re: How to pipe the psql copy command to Unix 'Date' command |
Previous Message | Frank Featherlight | 2009-02-20 01:25:19 | Re: Service not starting during install |