| From: | Nigel Horne <njh(at)bandsman(dot)co(dot)uk> |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | Updating timestamps |
| Date: | 2005-08-08 16:06:03 |
| Message-ID: | 1123517154.3706.3.camel@laptop1.home-network2.net |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2005-08-08 16:07:17 | Re: PL/pgSQL in 8.0 |
| Previous Message | Tom Lane | 2005-08-08 15:54:59 | Re: [GENERAL] postgresql Secure Mode |