Alvaro Herrera wrote:
> Is there a better way than going to time_t and back? I am currently
> using this:
>
> db->next_worker =
> time_t_to_timestamptz(timestamptz_to_time_t(current_time) +
> autovacuum_naptime);
>
> (db->next_worker is a T
Grzegorz Jaskiewicz wrote:
>
> On Mar 15, 2007, at 5:58 AM, Tom Lane wrote:
>
> >
> >? I'm not sure what would be the most convenient realization
> >of this at the C level, but please stay away from time_t ...
>
> what's wrong with time_t ? Does postgres has some sort of "time" API,
> that ca
--Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Alvaro Herrera
Sent: Wednesday, March 14, 2007 3:46 PM
To: Hackers
Subject: [HACKERS] how to add seconds to a TimestampTz
Is there a better way than going to time_t and back? I am currently
using this:
On Mar 15, 2007, at 5:58 AM, Tom Lane wrote:
? I'm not sure what would be the most convenient realization
of this at the C level, but please stay away from time_t ...
what's wrong with time_t ? Does postgres has some sort of "time" API,
that can be used instead?
--
Grzegorz Jaskiewicz
Tom Lane wrote:
> Alvaro Herrera <[EMAIL PROTECTED]> writes:
> > Is there a better way than going to time_t and back?
>
> Isn't the standard SQL-level locution
> timestamptz + numeric_value * '1 second'::interval
> ? I'm not sure what would be the most convenient realization
> of this at th
Alvaro Herrera <[EMAIL PROTECTED]> writes:
> Is there a better way than going to time_t and back?
Isn't the standard SQL-level locution
timestamptz + numeric_value * '1 second'::interval
? I'm not sure what would be the most convenient realization
of this at the C level, but please stay a
Is there a better way than going to time_t and back? I am currently
using this:
db->next_worker =
time_t_to_timestamptz(timestamptz_to_time_t(current_time) +
autovacuum_naptime);
(db->next_worker is a TimestampTz, as is current_time.