Re: Time manipulation..

From: Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
Cc: "Williams, Travis L, NPONS" <tlw(at)att(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Time manipulation..
Date: 2002-11-12 21:33:15
Message-ID: 3DD1739B.7010804@intransa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a related question...

Is it faster to set the time via now() during insert or let application
construct one, say a C++ app.
I'm thinking C++ is going to do a bunch of string processing to assemble
this time-stamp, then
PG is going to do some other string processing to convert it into an
internal binary format and
then store it. So perhaps its just faster to have now() set as the
default....

what would you say....

Robert Treat wrote:

>On Tue, 2002-11-12 at 14:35, Williams, Travis L, NPONS wrote:
>
>
>>If I have a date/time column using timestamp.. how can I manipulate the date/time easily.. like take the date/time and add 7 days to it and get the correct date.. or subtract 5 days.. or anything like that.. I can do it all in perl (which I have done in the past).. but I hate dealing with month/year roll overs..
>>
>>Travis
>>
>>
>>
>
>Well, you can easily do things like select now() + '7 days'::interval;
>or select now() - '5 days'::interval; and if you need just a part of
>the time use the date_part() function. check the docs for more info and
>other suggestions.
>
>Robert Treat
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message wsheldah 2002-11-12 22:10:23 Re: Time manipulation..
Previous Message Robert Treat 2002-11-12 20:44:35 Re: Time manipulation..