Updating timestamps - Mailing list pgsql-general

From Nigel Horne
Subject Updating timestamps
Date
Msg-id 1123517154.3706.3.camel@laptop1.home-network2.net
Whole thread Raw
Responses Simple PG Sql question (i hope)  (Tony Caduto <tony_caduto@amsoftwaredesign.com>)
List pgsql-general
Is it possible to update a timestamp with Postgresql?


I've looked around with google and it looks as though this should work:


exec sql begin declare section;
char api[18];
char    expiration_time[80];
exec sql end declare section;


memcpy(api, ap->api, sizeof(api));
sprintf(expiration_time, "%s + \"interval\"('0.01sec')",
ap->expiration_time);


puts(expiration_time);


exec sql update accesspoint
        set sequence_number = expiration_time = :expiration_time,
        where api = :api;


However, I just get this:
2005-08-02 10:37:41.198479 + "interval"('0.01sec')
'ERROR:  invalid input syntax for type timestamp: "2005-08-02 10:37:4

-Nigel


pgsql-general by date:

Previous
From: Martín Marqués
Date:
Subject: Re: PL/pgSQL in 8.0
Next
From: Tom Lane
Date:
Subject: Re: PL/pgSQL in 8.0