Re: [SQL] Date fields and libpq....

Поиск
Список
Период
Сортировка
От Colin Dick
Тема Re: [SQL] Date fields and libpq....
Дата
Msg-id Pine.LNX.3.96.980626140758.20477B-100000@ocis.ocis.net
обсуждение исходный текст
Ответ на Re: [SQL] Date fields and libpq....  (Kachun Lee <kachun@pathlink.com>)
Ответы Re: [SQL] Date fields and libpq....  (Kachun Lee <kachun@pathlink.com>)
Список pgsql-sql
> I think you may want to change your query to:
>
>    select date_part(datetime(abst_att), 'epoch') ....
>
> In addition, unless you were using BINARY cursor, you will need to do
> something like:
>
>   time_t t = atol(PQgetvalue(res, i, 0));

I have tried this but don't think I understand the internal datetime
function correctly.  Should my query be(start is defined as abstime):

select start(datetime(abst_att),'epoch') from timebase;

And then should this work:

printf("%lu\n",(unsigned long)PGgetvalue(res,0,0));

Thanks for your help.

--
Colin Dick
On Call Internet Services
cdick@mail.ocis.net


В списке pgsql-sql по дате отправления:

Предыдущее
От: Colin Dick
Дата:
Сообщение: Re: [SQL] isnull function]
Следующее
От: Kachun Lee
Дата:
Сообщение: Re: [SQL] Date fields and libpq....