Updating timestamps

Поиск
Список
Период
Сортировка
От Nigel Horne
Тема Updating timestamps
Дата
Msg-id 1123517154.3706.3.camel@laptop1.home-network2.net
обсуждение исходный текст
Ответы Simple PG Sql question (i hope)  (Tony Caduto <tony_caduto@amsoftwaredesign.com>)
Список 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 по дате отправления:

Предыдущее
От: Martín Marqués
Дата:
Сообщение: Re: PL/pgSQL in 8.0
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PL/pgSQL in 8.0